From dbdea0d1c025b18d4d82c278c87454427918f5b4 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 16 Oct 2019 19:21:40 +0100 Subject: COMPMID-2308: NEConvolutionLayer: support QUANT8_SYMM_PER_CHANNEL filters Change-Id: Ic1bf5f0d21ccd525f84213a360f7e199d7f50577 Signed-off-by: Georgios Pinitas Reviewed-on: https://review.mlplatform.org/c/2177 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Comments-Addressed: Arm Jenkins --- tests/validation/Helpers.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/validation/Helpers.cpp') diff --git a/tests/validation/Helpers.cpp b/tests/validation/Helpers.cpp index 4158793295..95a5548628 100644 --- a/tests/validation/Helpers.cpp +++ b/tests/validation/Helpers.cpp @@ -326,6 +326,24 @@ std::pair get_quantized_bounds(const QuantizationInfo &quant_info, flo return std::pair { min_bound, max_bound }; } +std::pair get_symm_quantized_per_channel_bounds(const QuantizationInfo &quant_info, float min, float max, size_t channel_id) +{ + ARM_COMPUTE_ERROR_ON_MSG(min > max, "min must be lower equal than max"); + + const int min_bound = quantize_qsymm8_per_channel(min, quant_info, channel_id); + const int max_bound = quantize_qsymm8_per_channel(max, quant_info, channel_id); + return std::pair { min_bound, max_bound }; +} + +std::pair get_asymm_quantized_per_channel_bounds(const QuantizationInfo &quant_info, float min, float max, size_t channel_id) +{ + ARM_COMPUTE_ERROR_ON_MSG(min > max, "min must be lower equal than max"); + + const int min_bound = quantize_qasymm8_per_channel(min, quant_info, channel_id); + const int max_bound = quantize_qasymm8_per_channel(max, quant_info, channel_id); + return std::pair { min_bound, max_bound }; +} + template void get_tile(const SimpleTensor &in, SimpleTensor &roi, const Coordinates &coord); template void get_tile(const SimpleTensor &in, SimpleTensor &roi, const Coordinates &coord); template void get_tile(const SimpleTensor &in, SimpleTensor &roi, const Coordinates &coord); -- cgit v1.2.1