diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2019-08-22 16:20:04 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-08-24 12:12:28 +0000 |
commit | 601ba3f3ee78f6bbc2d046648b064b9aaa7e88a6 (patch) | |
tree | 8655f8d67fddc040321120d2f5505d41948cedaf /src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp | |
parent | 3e183d98b28ff7c91bbb7166b6f4684cd0e6bd2e (diff) | |
download | ComputeLibrary-601ba3f3ee78f6bbc2d046648b064b9aaa7e88a6.tar.gz |
COMPMID-2336: Validate multiplier and offset calculation in LSTMQuantized and DepthwiseConvolution functions
This patch also adds validation of internal functions in LSTMQuantizedLayer.
Change-Id: Id8dbbfbb421f7d053410476b4bb4ef7d85e5f41e
Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Signed-off-by: giuros01 <giuseppe.rossini@arm.com>
Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1794
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp')
-rw-r--r-- | src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp index c78ad1a5b5..b8b144dbfa 100644 --- a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp +++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp @@ -96,6 +96,17 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *weights, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(output->tensor_shape(), output_shape); } + if(is_qasymm) + { + const UniformQuantizationInfo iq_info = input->quantization_info().uniform(); + const UniformQuantizationInfo wq_info = weights->quantization_info().uniform(); + const UniformQuantizationInfo oq_info = (output->total_size() != 0) ? output->quantization_info().uniform() : iq_info; + + float multiplier = iq_info.scale * wq_info.scale / oq_info.scale; + ARM_COMPUTE_UNUSED(multiplier); + ARM_COMPUTE_RETURN_ERROR_ON(multiplier > 1.0f); + } + return Status{}; } |