aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/utils
diff options
context:
space:
mode:
authorMohammed Suhail Munshi <MohammedSuhail.Munshi@arm.com>2022-05-12 11:00:36 +0100
committerMohmun02 <MohammedSuhail.Munshi@arm.com>2022-05-12 13:25:03 +0000
commitdc4f276b810c4746c684a81ffeeb22aa0bff2adc (patch)
treea4e6f63749cf88cee8078b8518831c260cc3a805 /arm_compute/core/utils
parent4e9f568f1055db8d5b6a969550787032b91854a5 (diff)
downloadComputeLibrary-dc4f276b810c4746c684a81ffeeb22aa0bff2adc.tar.gz
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 <MohammedSuhail.Munshi@arm.com> Change-Id: I143e7965e21b956abb05ba5c41e12c5b73b7345a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7558 Reviewed-by: Pablo Marquez Tello <pablo.tello@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/utils')
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h19
1 files changed, 4 insertions, 15 deletions
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