diff options
author | Pablo Tello <pablo.tello@arm.com> | 2019-06-03 14:59:48 +0100 |
---|---|---|
committer | Pablo Marquez <pablo.tello@arm.com> | 2019-06-20 16:24:33 +0000 |
commit | a28aebc5f80630683f50ce934e8584c6b0004beb (patch) | |
tree | 0764f6b51f76985ac3c788d123bb8f1e50da9ff5 /src/core | |
parent | e16c8906a2aedf00e910754a01fca8bc4189cfc7 (diff) | |
download | ComputeLibrary-a28aebc5f80630683f50ce934e8584c6b0004beb.tar.gz |
COMPMID-2383: DepthwiseConv use output qinfo
There was a problem in depthwise_conv where when needing to run
permute it was calling auto_init to initialise the temporary tensor
with input's qinfo instead of output's qinfo. This patch fixes
this and adds some tests to exercise the cases where we have different
qinfos
Change-Id: I396fbb4d73f6aa5efe03dc2dd727b3e13154d6f5
Signed-off-by: Pablo Tello <pablo.tello@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1270
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Giuseppe Rossini <giuseppe.rossini@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/core')
3 files changed, 3 insertions, 8 deletions
diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp index 615327a7cc..fe796e96b8 100644 --- a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp +++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp @@ -88,7 +88,7 @@ std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITen { // Output auto inizialitation if not yet initialized const TensorShape output_shape = compute_depthwise_convolution_shape(*input, *weights, conv_info, depth_multiplier, dilation); - auto_init_if_empty(*output, input->clone()->set_tensor_shape(output_shape)); + auto_init_if_empty(*output, input->clone()->set_tensor_shape(output_shape).set_quantization_info(output->quantization_info())); const unsigned int conv_stride_x = conv_info.stride().first; const unsigned int conv_stride_y = conv_info.stride().second; diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp index f489e82cb9..779cf25fdf 100644 --- a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp +++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp @@ -109,12 +109,7 @@ std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITen const TensorShape output_shape = arm_compute::misc::shape_calculator::compute_depthwise_convolution_shape( *input, TensorInfo(TensorShape(weights_width, weights_height), 1, weights->data_type()).set_data_layout(DataLayout::NCHW), conv_info, depth_multiplier, dilation); - // Output auto inizialitation if not yet initialized - auto_init_if_empty(*output, - output_shape, - 1, - input->data_type(), - input->quantization_info()); + auto_init_if_empty(*output, input->clone()->set_tensor_shape(output_shape).set_quantization_info(output->quantization_info())); const bool is_qasymm = is_data_type_quantized_asymmetric(input->data_type()); const bool is_stride_1_dilation_1 = ((conv_info.stride().first == conv_info.stride().second) && (conv_info.stride().first == 1) && dilation.x() == 1 && dilation.y() == 1); diff --git a/src/core/NEON/kernels/NEDepthwiseConvolutionLayer3x3Kernel.cpp b/src/core/NEON/kernels/NEDepthwiseConvolutionLayer3x3Kernel.cpp index 385be04e4a..e47786525e 100644 --- a/src/core/NEON/kernels/NEDepthwiseConvolutionLayer3x3Kernel.cpp +++ b/src/core/NEON/kernels/NEDepthwiseConvolutionLayer3x3Kernel.cpp @@ -195,7 +195,7 @@ std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITen const DataType output_dt = (input->data_type() == DataType::QASYMM8) ? DataType::S32 : input->data_type(); // Output auto inizialitation if not yet initialized - auto_init_if_empty(*output, input->clone()->set_is_resizable(true).reset_padding().set_tensor_shape(output_shape).set_data_type(output_dt)); + auto_init_if_empty(*output, input->clone()->set_is_resizable(true).reset_padding().set_tensor_shape(output_shape).set_data_type(output_dt).set_quantization_info(output->quantization_info())); // Configure kernel window (generic) const unsigned int conv_stride_x = conv_info.stride().first; |