aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/Helpers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/Helpers.cpp')
-rw-r--r--tests/validation/Helpers.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/validation/Helpers.cpp b/tests/validation/Helpers.cpp
index fd034b649e..eab6d5629f 100644
--- a/tests/validation/Helpers.cpp
+++ b/tests/validation/Helpers.cpp
@@ -302,6 +302,15 @@ void zeros(SimpleTensor<T> &in, const Coordinates &anchor, const TensorShape &sh
}
}
+std::pair<int, int> get_quantized_bounds(const QuantizationInfo &quant_info, float min, float max)
+{
+ ARM_COMPUTE_ERROR_ON_MSG(min > max, "min must be lower equal than max");
+
+ const int min_bound = quant_info.quantize(min, RoundingPolicy::TO_NEAREST_UP);
+ const int max_bound = quant_info.quantize(max, RoundingPolicy::TO_NEAREST_UP);
+ return std::pair<int, int>(min_bound, max_bound);
+}
+
template void get_tile(const SimpleTensor<float> &in, SimpleTensor<float> &roi, const Coordinates &coord);
template void get_tile(const SimpleTensor<half> &in, SimpleTensor<half> &roi, const Coordinates &coord);
template void zeros(SimpleTensor<float> &in, const Coordinates &anchor, const TensorShape &shape);