From 0a958cbb48816a074303ae218a90414fb619efed Mon Sep 17 00:00:00 2001 From: Giuseppe Rossini Date: Thu, 16 Jan 2020 16:38:56 +0000 Subject: COMPMID-3013: Transpose Convolution 2D VTS/CTS failures on CL Change-Id: If19eec7f7a09e1008cc83ddcc673de145fca471d Signed-off-by: Giuseppe Rossini Reviewed-on: https://review.mlplatform.org/c/2599 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Comments-Addressed: Arm Jenkins --- src/runtime/CL/functions/CLGEMMDeconvolutionLayer.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/runtime/CL/functions/CLGEMMDeconvolutionLayer.cpp') diff --git a/src/runtime/CL/functions/CLGEMMDeconvolutionLayer.cpp b/src/runtime/CL/functions/CLGEMMDeconvolutionLayer.cpp index 604147a37a..14bda11f5f 100644 --- a/src/runtime/CL/functions/CLGEMMDeconvolutionLayer.cpp +++ b/src/runtime/CL/functions/CLGEMMDeconvolutionLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 ARM Limited. + * Copyright (c) 2019-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -239,7 +239,18 @@ void CLGEMMDeconvolutionLayer::configure(const ICLTensor *input, const ICLTensor // Configure output stage for asymmetric quantized types if(_is_quantized) { + // gemmlowp adds the offsets (instead of subtracting them). Thus, we need to negate the original + // and restore them back to make it work properly. + QuantizationInfo iq_info = input->info()->quantization_info(); + QuantizationInfo wq_info = weights->info()->quantization_info(); + + input_to_use->info()->set_quantization_info(QuantizationInfo(iq_info.uniform().scale, -iq_info.uniform().offset)); + _reshaped_weights_t.info()->set_quantization_info(QuantizationInfo(wq_info.uniform().scale, -wq_info.uniform().offset)); + _mm_gemmlowp.configure(input_to_use, &_reshaped_weights_t, nullptr, &_gemm_output, gemm_info); + + input_to_use->info()->set_quantization_info(iq_info); + _reshaped_weights_t.info()->set_quantization_info(wq_info); } else { -- cgit v1.2.1