aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2019-06-03 14:59:48 +0100
committerPablo Marquez <pablo.tello@arm.com>2019-06-20 16:24:33 +0000
commita28aebc5f80630683f50ce934e8584c6b0004beb (patch)
tree0764f6b51f76985ac3c788d123bb8f1e50da9ff5 /src/runtime
parente16c8906a2aedf00e910754a01fca8bc4189cfc7 (diff)
downloadComputeLibrary-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/runtime')
-rw-r--r--src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp1
-rw-r--r--src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp5
-rw-r--r--src/runtime/NEON/functions/assembly/NEDepthwiseConvolutionAssemblyDispatch.cpp2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp b/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp
index e912740d69..16082775c3 100644
--- a/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp
+++ b/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp
@@ -90,6 +90,7 @@ void CLDepthwiseConvolutionLayer3x3::configure(ICLTensor *input, const ICLTensor
// Configure the function to transform the weights tensor from HWI -> IHW
_permute_weights_to_nchw.configure(weights, &_permuted_weights, PermutationVector(1U, 2U, 0U));
_permuted_weights.info()->set_data_layout(DataLayout::NCHW);
+ _permuted_output.info()->set_quantization_info(output->info()->quantization_info());
input_to_use = &_permuted_input;
weights_to_use = &_permuted_weights;
diff --git a/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp b/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp
index 4bc8439d93..43288ec4c6 100644
--- a/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp
+++ b/src/runtime/NEON/functions/NEDepthwiseConvolutionLayer.cpp
@@ -87,6 +87,7 @@ void NEDepthwiseConvolutionLayer3x3::configure_generic(ITensor
// Configure the function to transform the weights tensor from HWI -> IHW
_permute_weights.configure(weights, &_permuted_weights, PermutationVector(1U, 2U, 0U));
_permuted_weights.info()->set_data_layout(DataLayout::NCHW);
+ _permuted_output.info()->set_quantization_info(output->info()->quantization_info());
// Configure depthwise
_dwc_kernel.configure(&_permuted_input, &_permuted_weights, (_is_quantized) ? &_accumulator : &_permuted_output, conv_info, depth_multiplier, dilation);
@@ -164,6 +165,9 @@ void NEDepthwiseConvolutionLayer3x3::configure_optimized(const ITensor
_permute_weights.configure(weights, &_permuted_weights, PermutationVector(2U, 0U, 1U));
_permuted_weights.info()->set_data_layout(DataLayout::NHWC);
+ _permuted_output.info()->set_data_layout(DataLayout::NHWC);
+ _permuted_output.info()->set_quantization_info(output->info()->quantization_info());
+
// Configure optimized depthwise
_dwc_optimized_func.configure(&_permuted_input, &_permuted_weights, biases, &_permuted_output, conv_info, depth_multiplier, act_info_to_use);
@@ -423,6 +427,7 @@ void NEDepthwiseConvolutionLayer::configure(ITensor *input, const ITensor *weigh
permute(output_shape, PermutationVector(1U, 2U, 0U));
_permuted_output.allocator()->init(output->info()->clone()->set_is_resizable(true).reset_padding().set_tensor_shape(output_shape));
_permuted_output.info()->set_data_layout(DataLayout::NCHW);
+ _permuted_output.info()->set_quantization_info(output->info()->quantization_info());
output_to_use = &_permuted_output;
}
diff --git a/src/runtime/NEON/functions/assembly/NEDepthwiseConvolutionAssemblyDispatch.cpp b/src/runtime/NEON/functions/assembly/NEDepthwiseConvolutionAssemblyDispatch.cpp
index 0499d9930f..5f57bbfe23 100644
--- a/src/runtime/NEON/functions/assembly/NEDepthwiseConvolutionAssemblyDispatch.cpp
+++ b/src/runtime/NEON/functions/assembly/NEDepthwiseConvolutionAssemblyDispatch.cpp
@@ -176,7 +176,7 @@ void NEDepthwiseConvolutionAssemblyDispatch::configure(const ITensor
// Output auto inizialitation if not yet initialized
const TensorShape output_shape = misc::shape_calculator::compute_depthwise_convolution_shape(*input->info(), *weights->info(), conv_info, depth_multiplier);
- auto_init_if_empty(*output->info(), input->info()->clone()->set_is_resizable(true).reset_padding().set_tensor_shape(output_shape));
+ auto_init_if_empty(*output->info(), input->info()->clone()->set_is_resizable(true).reset_padding().set_tensor_shape(output_shape).set_quantization_info(output->info()->quantization_info()));
_input = input;
_weights = weights;