diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2019-10-09 15:32:39 +0100 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2019-10-30 14:44:46 +0000 |
commit | df4cf57c7394265b27d051cb1cf0152c53659126 (patch) | |
tree | 87da5d6abeff65b2cee55b63f73bb268776af560 /arm_compute/core/utils/quantization | |
parent | 8b72199f25487040713d1668c998fdde3707413c (diff) | |
download | ComputeLibrary-df4cf57c7394265b27d051cb1cf0152c53659126.tar.gz |
COMPMID-2306: CLDepthwiseConvolution: support for QUANT8_PER_CHANNEL_SYMM
Change-Id: I18c886400daa2dcba0b91011bc4e503d807a4732
Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2143
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/utils/quantization')
-rw-r--r-- | arm_compute/core/utils/quantization/AsymmHelpers.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arm_compute/core/utils/quantization/AsymmHelpers.h b/arm_compute/core/utils/quantization/AsymmHelpers.h index bc5b9dbdba..8ec4a331f6 100644 --- a/arm_compute/core/utils/quantization/AsymmHelpers.h +++ b/arm_compute/core/utils/quantization/AsymmHelpers.h @@ -25,6 +25,7 @@ #define __ARM_COMPUTE_QUANTIZATION_ASYMM_HELPERS_H__ #include "arm_compute/core/Error.h" +#include "arm_compute/core/ITensor.h" #include "arm_compute/core/Types.h" namespace arm_compute @@ -60,9 +61,23 @@ Status calculate_quantized_multiplier_less_than_one(float multiplier, int *quant Status calculate_quantized_multiplier_greater_than_one(float multiplier, int *quantized_multiplier, int *left_shift); /** Get minimum and maximum values for the input quantized data type * - * @ return min and max values for the quantized data type + * @return min and max values for the quantized data type */ std::pair<int, int> get_min_max_values_from_quantized_data_type(DataType data_type); +/** Compute quantized per-channel multipliers and shifts. As many multipliers + * and shifts as output channels are computed. If weights are not quantized + * per-channel, multipliers and shifts will end up being the same for each + * channel. + * + * @param[in] input Input tensor. + * @param[in] weights Weights tensor. + * @param[in] output Output tensor. + * @param[out] output_multipliers_ptr Pointer to the buffer where to store per-channel multipliers. + * @param[out] output_shifts_ptr Pointer to the buffer where to store per-channel shifts. + * + * @return min and max values for the quantized data type + */ +void compute_quantized_multipliers_and_shifts(const ITensor *input, const ITensor *weights, const ITensor *output, int32_t *output_multipliers_ptr, int32_t *output_shifts_ptr); } // namespace quantization } // namespace arm_compute #endif /* __ARM_COMPUTE_IO_FILE_HANDLER_H__ */ |