From 9688378ce14f0c2663a27b2c879ed1928247a08e Mon Sep 17 00:00:00 2001 From: Sanghoon Lee Date: Fri, 15 Sep 2017 14:10:48 +0100 Subject: COMPMID-494: Port BatchNormalizationLayer to new validation Change-Id: Ief5334dd1cf571d977acf4ce9e5f580c5c9ab433 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/88158 Tested-by: Kaizen Reviewed-by: Pablo Tello --- tests/validation/Helpers.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests/validation/Helpers.h') 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 +std::pair get_batchnormalization_layer_test_bounds(int fixed_point_position = 1) +{ + bool is_float = std::is_floating_point::value; + std::pair 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 -- cgit v1.2.1