From aeebe4ad332bc6dd4797243b39ec6000975429c5 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Wed, 9 Jan 2019 14:21:03 +0000 Subject: COMPMID-1652 NEON Cleanup and add missing tests Change-Id: I7b351f18a78ed8a250bf3a91ef320db61984146a Reviewed-on: https://review.mlplatform.org/485 Reviewed-by: Isabella Gottardi Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio --- tests/validation/NEON/DequantizationLayer.cpp | 42 +++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'tests/validation/NEON/DequantizationLayer.cpp') diff --git a/tests/validation/NEON/DequantizationLayer.cpp b/tests/validation/NEON/DequantizationLayer.cpp index 9bdba7204f..70433acdec 100644 --- a/tests/validation/NEON/DequantizationLayer.cpp +++ b/tests/validation/NEON/DequantizationLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -55,6 +55,38 @@ const auto DequantizationShapes = concat(concat(concat(datasets::Small3DShapes() TEST_SUITE(NEON) TEST_SUITE(DequantizationLayer) +// *INDENT-OFF* +// clang-format off +DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( + framework::dataset::make("InputInfo", { TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::F32), // Wrong input data type + TensorInfo(TensorShape(16U, 5U, 16U), 1, DataType::U8), // Invalid shape + TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::U8), // Wrong output data type + TensorInfo(TensorShape(16U, 16U, 2U, 5U), 1, DataType::U8), // Missmatching shapes + TensorInfo(TensorShape(17U, 16U, 16U, 5U), 1, DataType::U8), // Shrink window + TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::U8), // Valid + }), + framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::F32), + TensorInfo(TensorShape(16U, 5U, 16U), 1, DataType::U8), + TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::U8), + TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::F32), + TensorInfo(TensorShape(17U, 16U, 16U, 5U), 1, DataType::F32), + TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::F32), + })), + framework::dataset::make("MinMax",{ TensorInfo(TensorShape(2U), 1, DataType::F32), + TensorInfo(TensorShape(2U), 1, DataType::U8), + TensorInfo(TensorShape(2U), 1, DataType::F32), + TensorInfo(TensorShape(2U), 1, DataType::F32), + TensorInfo(TensorShape(2U), 1, DataType::U8), + TensorInfo(TensorShape(2U), 1, DataType::U8), + })), + framework::dataset::make("Expected", { false, false, false, false, false, true})), + input_info, output_info, min_max, expected) +{ + ARM_COMPUTE_EXPECT(bool(NEDequantizationLayer::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), &min_max.clone()->set_is_resizable(false))) == expected, framework::LogLevel::ERRORS); +} +// clang-format on +// *INDENT-ON* + DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(DequantizationShapes, framework::dataset::make("DataType", DataType::U8)), shape, data_type) { TensorShape shape_min_max = shape; @@ -113,11 +145,11 @@ FIXTURE_DATA_TEST_CASE(RunLarge, NEDequantizationLayerFixture, framewor // Validate output validate(Accessor(_target), _reference, tolerance_f32); } -TEST_SUITE_END() -TEST_SUITE_END() +TEST_SUITE_END() // U8 +TEST_SUITE_END() // Integer -TEST_SUITE_END() -TEST_SUITE_END() +TEST_SUITE_END() // DequantizationLayer +TEST_SUITE_END() // NEON } // namespace validation } // namespace test } // namespace arm_compute -- cgit v1.2.1