From c58f0ad7ac6d91f2789a78049d3cec7355113f9a Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Fri, 7 Aug 2020 16:49:15 +0100 Subject: COMPMID-3502: Add support of different quantization input/output for ReduceMean Change-Id: If9a5c6ee3902a7381f4117e473adbddf006f3347 Signed-off-by: Manuel Bottini Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3731 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Sang-Hoon Park --- tests/validation/NEON/ReduceMean.cpp | 42 ++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) (limited to 'tests/validation/NEON/ReduceMean.cpp') diff --git a/tests/validation/NEON/ReduceMean.cpp b/tests/validation/NEON/ReduceMean.cpp index 23229a08ef..e5a5a175fb 100644 --- a/tests/validation/NEON/ReduceMean.cpp +++ b/tests/validation/NEON/ReduceMean.cpp @@ -160,16 +160,33 @@ TEST_SUITE(QASYMM8) FIXTURE_DATA_TEST_CASE(RunSmall, NEReduceMeanQuantizedFixture, framework::DatasetMode::PRECOMMIT, - combine(combine(combine(datasets::Small4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8)), concat(axis_keep, axis_drop)), framework::dataset::make("QuantizationInfo", { QuantizationInfo(1.f / 255, 5) }))) + combine(combine(combine(combine(datasets::Small4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8)), concat(axis_keep, axis_drop)), + framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(1.f / 255, 5) })), + framework::dataset::make("QuantizationInfoOutput", { QuantizationInfo(1.f / 255, 5) }))) { // Validate output validate(Accessor(_target), _reference, tolerance_u8); } +TEST_SUITE(Requant) +FIXTURE_DATA_TEST_CASE(RunSmall, + NEReduceMeanQuantizedFixture, + framework::DatasetMode::PRECOMMIT, + combine(combine(combine(combine(datasets::Small4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8)), axis_drop), + framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(1.f / 255, 5) })), + framework::dataset::make("QuantizationInfoOutput", { QuantizationInfo(1.f / 200, 16) }))) +{ + // Validate output + validate(Accessor(_target), _reference, tolerance_u8); +} +TEST_SUITE_END() // Requant + FIXTURE_DATA_TEST_CASE(RunLarge, NEReduceMeanQuantizedFixture, framework::DatasetMode::NIGHTLY, - combine(combine(combine(datasets::Large4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8)), concat(axis_keep, axis_drop)), framework::dataset::make("QuantizationInfo", { QuantizationInfo(1.f / 255, 5) }))) + combine(combine(combine(combine(datasets::Large4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8)), concat(axis_keep, axis_drop)), + framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(1.f / 255, 5) })), + framework::dataset::make("QuantizationInfoOutput", { QuantizationInfo(1.f / 255, 5) }))) { // Validate output validate(Accessor(_target), _reference, tolerance_u8); @@ -180,15 +197,32 @@ TEST_SUITE(QASYMM8_SIGNED) FIXTURE_DATA_TEST_CASE(RunSmall, NEReduceMeanQuantizedFixture, framework::DatasetMode::PRECOMMIT, - combine(combine(combine(datasets::Small4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), concat(axis_keep, axis_drop)), framework::dataset::make("QuantizationInfo", { QuantizationInfo(1.f / 127, -10), QuantizationInfo(1.f / 250, -20) }))) + combine(combine(combine(combine(datasets::Small4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), concat(axis_keep, axis_drop)), + framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(1.f / 127, -10), QuantizationInfo(1.f / 250, -20) })), + framework::dataset::make("QuantizationInfoInputOutput", { QuantizationInfo(1.f / 127, -10) }))) { // Validate output validate(Accessor(_target), _reference, tolerance_s8); } +TEST_SUITE(Requant) +FIXTURE_DATA_TEST_CASE(RunSmall, + NEReduceMeanQuantizedFixture, + framework::DatasetMode::PRECOMMIT, + combine(combine(combine(combine(datasets::Small4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), axis_drop), + framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(1.f / 102, 2) })), + framework::dataset::make("QuantizationInfoOutput", { QuantizationInfo(1.f / 113, 10) }))) +{ + // Validate output + validate(Accessor(_target), _reference, tolerance_s8); +} +TEST_SUITE_END() // Requant + FIXTURE_DATA_TEST_CASE(RunLarge, NEReduceMeanQuantizedFixture, framework::DatasetMode::NIGHTLY, - combine(combine(combine(datasets::Large4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), concat(axis_keep, axis_drop)), framework::dataset::make("QuantizationInfo", { QuantizationInfo(1.f / 127, 0) }))) + combine(combine(combine(combine(datasets::Large4DShapes(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), concat(axis_keep, axis_drop)), + framework::dataset::make("QuantizationInfoInput", { QuantizationInfo(1.f / 127, -10) })), + framework::dataset::make("QuantizationInfoInputOutput", { QuantizationInfo(1.f / 127, -10) }))) { // Validate output validate(Accessor(_target), _reference, tolerance_s8); -- cgit v1.2.1