aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/Helpers.h
diff options
context:
space:
mode:
authorSanghoon Lee <sanghoon.lee@arm.com>2017-09-15 14:10:48 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commit9688378ce14f0c2663a27b2c879ed1928247a08e (patch)
treecf7241f58b054eb3acf6a8e5331cb8c7b74b8e62 /tests/validation/Helpers.h
parent6a3e976d71ecca2e6fdb604618fd94969eff9861 (diff)
downloadComputeLibrary-9688378ce14f0c2663a27b2c879ed1928247a08e.tar.gz
COMPMID-494: Port BatchNormalizationLayer to new validation
Change-Id: Ief5334dd1cf571d977acf4ce9e5f580c5c9ab433 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/88158 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'tests/validation/Helpers.h')
-rw-r--r--tests/validation/Helpers.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h
index 85002eb599..30c67245a2 100644
--- a/tests/validation/Helpers.h
+++ b/tests/validation/Helpers.h
@@ -202,6 +202,31 @@ void fill_lookuptable(T &&table)
table[i] = distribution(generator);
}
}
+
+/** Helper function to get the testing range for batch normalization layer.
+ *
+ * @param[in] fixed_point_position (Optional) Number of bits for the fractional part. Defaults to 1.
+ *
+ * @return A pair containing the lower upper testing bounds.
+ */
+template <typename T>
+std::pair<T, T> get_batchnormalization_layer_test_bounds(int fixed_point_position = 1)
+{
+ bool is_float = std::is_floating_point<T>::value;
+ std::pair<T, T> bounds;
+
+ // Set initial values
+ if(is_float)
+ {
+ bounds = std::make_pair(-1.f, 1.f);
+ }
+ else
+ {
+ bounds = std::make_pair(1, 1 << (fixed_point_position));
+ }
+
+ return bounds;
+}
} // namespace validation
} // namespace test
} // namespace arm_compute