aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/utils/misc
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2018-01-31 10:30:59 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:37 +0000
commitdfca60b8e8805966624c7c941f289e090e3d73bb (patch)
treeee2763d823ed3d0dc68caef76edd6c991764c5c0 /arm_compute/core/utils/misc
parentfe5ef38cdbc1e9a44c3786744dfc0cc915a608a6 (diff)
downloadComputeLibrary-dfca60b8e8805966624c7c941f289e090e3d73bb.tar.gz
COMPMID-811 Add NHWC data format support for CL depthwise convolution QASYMM8
Change-Id: I89de432f3fbcba7abf9e1d4f8396a4334b4fa2c2 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/118324 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'arm_compute/core/utils/misc')
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h
index e174227302..b91e52a657 100644
--- a/arm_compute/core/utils/misc/ShapeCalculator.h
+++ b/arm_compute/core/utils/misc/ShapeCalculator.h
@@ -130,15 +130,19 @@ inline TensorShape compute_depthwise_convolution_shape(const ITensorInfo &input,
const TensorShape input_shape{ input.tensor_shape() };
const TensorShape weights_shape{ weights.tensor_shape() };
+ const DataLayout data_layout = input.data_layout();
+ const int width_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH);
+ const int height_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT);
+
unsigned int output_width = 0;
unsigned int output_height = 0;
- std::tie(output_width, output_height) = scaled_dimensions(input_shape.x(), input_shape.y(),
- weights_shape.x(), weights_shape.y(),
+ std::tie(output_width, output_height) = scaled_dimensions(input_shape[width_idx], input_shape[height_idx],
+ weights_shape[width_idx], weights_shape[height_idx],
conv_info);
TensorShape output_shape{ input_shape };
- output_shape.set(0, output_width);
- output_shape.set(1, output_height);
+ output_shape.set(width_idx, output_width);
+ output_shape.set(height_idx, output_height);
return output_shape;
}