From 980002bd5848f065b02a31bb105e47a5deb7bc98 Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Wed, 8 Aug 2018 09:25:51 +0100 Subject: COMPMID-1343: Add grouping support to CLCol2ImKernel Change-Id: I5188a2163e7341f1915d98c21464fea13a9a7faf Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/143330 Tested-by: Jenkins Reviewed-by: Anthony Barbier Reviewed-by: Giorgio Arena --- arm_compute/core/utils/misc/ShapeCalculator.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'arm_compute/core/utils') diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index fc6abf95f3..8a00c22306 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -140,13 +140,19 @@ inline TensorShape compute_reductionB_shape(const ITensorInfo &a) return shape_vector_sum_row; } -inline TensorShape compute_col2im_shape(const ITensorInfo &input, std::pair convolved_dims) +inline TensorShape compute_col2im_shape(const ITensorInfo &input, std::pair convolved_dims, unsigned int num_groups = 1) { + ARM_COMPUTE_ERROR_ON(num_groups == 0); + ARM_COMPUTE_ERROR_ON(input.tensor_shape()[1] != (convolved_dims.first * convolved_dims.second)); + ARM_COMPUTE_ERROR_ON((num_groups > 1) && input.tensor_shape()[2] != num_groups); + TensorShape col2im_shape{ input.tensor_shape() }; - col2im_shape.shift_right(1); col2im_shape.set(0, convolved_dims.first); col2im_shape.set(1, convolved_dims.second); - col2im_shape.set(2, input.tensor_shape()[0]); + col2im_shape.set(2, input.tensor_shape()[0] * num_groups); + + const unsigned int batch_idx = (num_groups == 1) ? 2 : 3; + col2im_shape.set(3, input.tensor_shape()[batch_idx]); return col2im_shape; } -- cgit v1.2.1