diff options
author | Pablo Tello <pablo.tello@arm.com> | 2017-06-26 17:17:42 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-09-17 14:16:42 +0100 |
commit | 0c34fe29c298057091d48cde332cb60bb14efee1 (patch) | |
tree | f77502715904a522b0e76f32eb1bcd6ce2f567dc /tests/validation/TensorOperations.h | |
parent | 2b26b850c0cff6a25f1012e9e4e7fe6654364a88 (diff) | |
download | ComputeLibrary-0c34fe29c298057091d48cde332cb60bb14efee1.tar.gz |
COMPMID-421: Added FP16 support in Pooling Layer
Change-Id: I6b6119c8770051c1656da40aa073c539c15b493e
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/78985
Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'tests/validation/TensorOperations.h')
-rw-r--r-- | tests/validation/TensorOperations.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/validation/TensorOperations.h b/tests/validation/TensorOperations.h index 67dadd6da3..b8e5a6678c 100644 --- a/tests/validation/TensorOperations.h +++ b/tests/validation/TensorOperations.h @@ -44,6 +44,26 @@ #include <string> #include <vector> +#if ARM_COMPUTE_ENABLE_FP16 +//Beware! most std templates acting on types don't work with the data type float16_t +namespace std +{ +template <> +class numeric_limits<float16_t> +{ +public: + static float16_t lowest() + { + return -std::numeric_limits<float>::max(); // -inf + }; + static float16_t max() + { + return std::numeric_limits<float>::max(); // +inf + }; +}; +} +#endif /* ARM_COMPUTE_ENABLE_FP16 */ + namespace arm_compute { namespace test @@ -1476,7 +1496,7 @@ void pooling_layer(const Tensor<T> &in, Tensor<T> &out, PoolingLayerInfo pool_in { for(int x = wstart; x < wend; ++x) { - T val = in[r * h_in * w_in + y * w_in + x]; + const T val = in[r * h_in * w_in + y * w_in + x]; if(val > max_val) { max_val = val; |