aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/NEON/QuantizationLayer.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2019-01-09 14:21:03 +0000
committerMichalis Spyrou <michalis.spyrou@arm.com>2019-01-11 12:32:03 +0000
commitaeebe4ad332bc6dd4797243b39ec6000975429c5 (patch)
tree68866e55aa29ad860ee9d222869b4add2551619b /tests/validation/NEON/QuantizationLayer.cpp
parentee7c15d8a57b6e1a0a98edf2bb4693024d9c15dd (diff)
downloadComputeLibrary-aeebe4ad332bc6dd4797243b39ec6000975429c5.tar.gz
COMPMID-1652 NEON Cleanup and add missing tests
Change-Id: I7b351f18a78ed8a250bf3a91ef320db61984146a Reviewed-on: https://review.mlplatform.org/485 Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'tests/validation/NEON/QuantizationLayer.cpp')
-rw-r--r--tests/validation/NEON/QuantizationLayer.cpp35
1 files changed, 30 insertions, 5 deletions
diff --git a/tests/validation/NEON/QuantizationLayer.cpp b/tests/validation/NEON/QuantizationLayer.cpp
index 26657c4062..30b4a57abf 100644
--- a/tests/validation/NEON/QuantizationLayer.cpp
+++ b/tests/validation/NEON/QuantizationLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -54,6 +54,31 @@ const auto QuantizationShapes = concat(concat(concat(datasets::Small3DShapes(),
TEST_SUITE(NEON)
TEST_SUITE(QuantizationLayer)
+// *INDENT-OFF*
+// clang-format off
+DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(
+ framework::dataset::make("InputInfo", { TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::U8), // Wrong input data type
+ TensorInfo(TensorShape(16U, 5U, 16U), 1, DataType::U8), // Invalid shape
+ TensorInfo(TensorShape(16U, 16U, 16U, 5U), 1, DataType::F32), // 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::F32), // 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::U16),
+ 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::U8),
+ })),
+ framework::dataset::make("Expected", { false, false, false, false, false, true})),
+ input_info, output_info, expected)
+{
+ ARM_COMPUTE_EXPECT(bool(NEQuantizationLayer::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false))) == expected, framework::LogLevel::ERRORS);
+}
+// clang-format on
+// *INDENT-ON*
+
DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(QuantizationShapes, framework::dataset::make("DataType", DataType::F32)), shape, data_type)
{
// Create tensors
@@ -95,11 +120,11 @@ FIXTURE_DATA_TEST_CASE(RunLarge, NEQuantizationLayerFixture<float>, framework::D
// Validate output
validate(Accessor(_target), _reference, tolerance_u8);
}
-TEST_SUITE_END()
-TEST_SUITE_END()
+TEST_SUITE_END() // FP32
+TEST_SUITE_END() // Float
-TEST_SUITE_END()
-TEST_SUITE_END()
+TEST_SUITE_END() // QuantizationLayer
+TEST_SUITE_END() // NEON
} // namespace validation
} // namespace test
} // namespace arm_compute