From dc4f276b810c4746c684a81ffeeb22aa0bff2adc Mon Sep 17 00:00:00 2001 From: Mohammed Suhail Munshi Date: Thu, 12 May 2022 11:00:36 +0100 Subject: Revert "Add support for 2d and 3d indices for axis 0" This reverts commit 0db8b8bbd941b3dab4238c03e734e7ac43c662ed. Relates to [COMPMID-5055] Signed-off-by: Mohammed Suhail Munshi Change-Id: I143e7965e21b956abb05ba5c41e12c5b73b7345a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7558 Reviewed-by: Pablo Marquez Tello Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- arm_compute/core/utils/misc/ShapeCalculator.h | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 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 aa51ad209a..df907c106e 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -1496,24 +1496,13 @@ inline TensorShape compute_pool3d_shape(const TensorShape &src, Pooling3dLayerIn inline TensorShape compute_gather_shape(const TensorShape &input_shape, const TensorShape &indices_shape, uint32_t actual_axis) { + ARM_COMPUTE_ERROR_ON(indices_shape.num_dimensions() > 1); ARM_COMPUTE_ERROR_ON(input_shape.num_dimensions() > 4); ARM_COMPUTE_ERROR_ON(actual_axis >= input_shape.num_dimensions()); - TensorShape output_shape = input_shape; - if(indices_shape.num_dimensions() == 1u) - { - output_shape[actual_axis] = indices_shape[0]; - } - else - { - const auto inddims{ indices_shape.num_dimensions() }; - output_shape.shift_right(indices_shape.num_dimensions() - 1); - output_shape[0] = input_shape[0]; - for(size_t idx(1); (idx - 1) < inddims; ++idx) - { - output_shape.set(actual_axis + idx, indices_shape[idx - 1], false); - } - } + TensorShape output_shape = input_shape; + output_shape[actual_axis] = indices_shape[0]; + return output_shape; } } // namespace shape_calculator -- cgit v1.2.1