From a0205b987509d239b1635024fe8f334a4534f56e Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Tue, 7 Jul 2020 09:36:09 +0100 Subject: COMPMID-3574: add logarithm to LogSoftmaxLayer Missed logarithm for the summation is added to NEON, CL and reference backends. To avoid complex changes, log softmax layer on CL backend doesn't support quantized data types. Tests and doxygen comments are modified accordingly. Change-Id: Iafd29291be8b81345cb4999b2668dbc3ae0c3345 Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3517 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: SiCong Li Comments-Addressed: Arm Jenkins --- tests/validation/CL/LogSoftmaxLayer.cpp | 58 +++------------------------------ 1 file changed, 5 insertions(+), 53 deletions(-) (limited to 'tests/validation/CL/LogSoftmaxLayer.cpp') diff --git a/tests/validation/CL/LogSoftmaxLayer.cpp b/tests/validation/CL/LogSoftmaxLayer.cpp index 39d2483ab8..420e6b2fc1 100644 --- a/tests/validation/CL/LogSoftmaxLayer.cpp +++ b/tests/validation/CL/LogSoftmaxLayer.cpp @@ -46,17 +46,6 @@ namespace /** Tolerance for float operations */ RelativeTolerance tolerance_f16(half(0.2)); RelativeTolerance tolerance_f32(0.001f); - -/** Tolerance for quantized operations */ -constexpr AbsoluteTolerance tolerance_qasymm8(1); - -/** CNN data types */ -const auto CNNDataTypes = framework::dataset::make("DataType", -{ - DataType::QASYMM8, - DataType::F16, - DataType::F32, -}); } // namespace TEST_SUITE(CL) @@ -91,7 +80,7 @@ FIXTURE_DATA_TEST_CASE(Run4D, CLLogSoftmaxLayerFixture, framework::Dataset // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); } -TEST_SUITE_END() +TEST_SUITE_END() // FP16 TEST_SUITE(FP32) FIXTURE_DATA_TEST_CASE(RunSmall, CLLogSoftmaxLayerFixture, framework::DatasetMode::ALL, combine(combine(combine(datasets::SoftmaxLayerSmallShapes(), @@ -118,47 +107,10 @@ FIXTURE_DATA_TEST_CASE(Run4D, CLLogSoftmaxLayerFixture, framework::Datase // Validate output validate(CLAccessor(_target), _reference, tolerance_f32); } -TEST_SUITE_END() -TEST_SUITE_END() - -template -using CLLogSoftmaxLayerQuantizedFixture = SoftmaxValidationQuantizedFixture; - -TEST_SUITE(Quantized) -TEST_SUITE(QASYMM8) -FIXTURE_DATA_TEST_CASE(RunSmall, CLLogSoftmaxLayerQuantizedFixture, framework::DatasetMode::ALL, combine(combine(combine(datasets::SoftmaxLayerSmallShapes(), - framework::dataset::make("DataType", DataType::QASYMM8)), - combine(framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, -10) }), - framework::dataset::make("Beta", { 1.0f, 2.f }))), - framework::dataset::make("ReduceEndAxis", { 0, 1 }))) -{ - // Validate output - validate(CLAccessor(_target), _reference, tolerance_qasymm8); -} -FIXTURE_DATA_TEST_CASE(RunLarge, CLLogSoftmaxLayerQuantizedFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::SoftmaxLayerLargeShapes(), - framework::dataset::make("DataType", DataType::QASYMM8)), - combine(framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, -10) }), - framework::dataset::make("Beta", { 1.0f, 2.0f }))), - framework::dataset::make("ReduceEndAxis", { 0 }))) -{ - // Validate output - validate(CLAccessor(_target), _reference, tolerance_qasymm8); -} -FIXTURE_DATA_TEST_CASE(Run4D, CLLogSoftmaxLayerQuantizedFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::SoftmaxLayer4DShapes(), - framework::dataset::make("DataType", DataType::QASYMM8)), - combine(framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, -10) }), - framework::dataset::make("Beta", { 1.0f, 2.0f }))), - framework::dataset::make("ReduceEndAxis", { 0, 1, 2 }))) -{ - // Validate output - validate(CLAccessor(_target), _reference, tolerance_qasymm8); -} - -TEST_SUITE_END() -TEST_SUITE_END() - -TEST_SUITE_END() -TEST_SUITE_END() +TEST_SUITE_END() // FP32 +TEST_SUITE_END() // Float +TEST_SUITE_END() // LogSoftmaxLayer +TEST_SUITE_END() // CL } // namespace validation } // namespace test } // namespace arm_compute -- cgit v1.2.1