Fix tolerance for NEON RNNLayer
authorManuel Bottini <manuel.bottini@arm.com>
Fri, 5 Feb 2021 12:53:41 +0000 (12:53 +0000)
committerManuel Bottini <manuel.bottini@arm.com>
Fri, 5 Feb 2021 14:48:36 +0000 (14:48 +0000)
Use same absolute tolerance as in the GPU backend

Change-Id: I92d8ce93ca189dad70dff6226b3b501b724cea33
Resolves: COMPMID-4239
Signed-off-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5010
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
tests/validation/NEON/RNNLayer.cpp

index 7a3117a0b36aca4e4a94807c1185d7a011daeba4..f8559ff88ea4ad158d621b31ee5c80444e81a5d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Arm Limited.
+ * Copyright (c) 2018-2021 Arm Limited.
  *
  * SPDX-License-Identifier: MIT
  *
@@ -39,8 +39,9 @@ namespace validation
 {
 namespace
 {
-RelativeTolerance<float> tolerance_f32(0.001f);
-RelativeTolerance<half>  tolerance_f16(half(0.1));
+RelativeTolerance<float> tolerance_f32(0.001f);    /**< Relative tolerance value for comparing reference's output against implementation's output for DataType:F32 */
+RelativeTolerance<half>  tolerance_f16(half(0.1)); /**< Relative tolerance value for comparing reference's output against implementation's output for DataType:F16 */
+constexpr float          abs_tolerance_f16(0.02f); /**< Absolute tolerance value for comparing reference's output against implementation's output for DataType:F16 */
 } // namespace
 
 TEST_SUITE(NEON)
@@ -136,7 +137,7 @@ TEST_SUITE(FP16)
 FIXTURE_DATA_TEST_CASE(RunSmall, NERNNLayerFixture<half>, framework::DatasetMode::ALL, combine(datasets::SmallRNNLayerDataset(), framework::dataset::make("DataType", DataType::F16)))
 {
     // Validate output
-    validate(Accessor(_target), _reference, tolerance_f16);
+    validate(Accessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16);
 }
 TEST_SUITE_END() // FP16
 #endif           /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */