From dea2d2d58fe3a742e6f66fe50befbe0044e15ad1 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 19 Dec 2018 16:23:17 +0000 Subject: COMPMID-1772: Implement PadV2 for NEON Change-Id: Ia4604524a034c46b004fd850183480c5fbfd8cb3 Reviewed-on: https://review.mlplatform.org/437 Tested-by: Arm Jenkins Reviewed-by: Michalis Spyrou --- arm_compute/core/utils/misc/ShapeCalculator.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (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 619234d306..f8a6df7fe7 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -1011,7 +1011,9 @@ inline TensorShape compute_padded_shape(const TensorShape &input_shape, const Pa TensorShape padded_shape = input_shape; for(size_t dim = 0; dim < padding.size(); ++dim) { - padded_shape.set(dim, padding[dim].first + input_shape[dim] + padding[dim].second); + const auto &padding_pair = padding[dim]; + const uint32_t shape_on_index = (padded_shape.num_dimensions() <= dim) ? 1 : input_shape[dim]; + padded_shape.set(dim, padding_pair.first + shape_on_index + padding_pair.second); } return padded_shape; } -- cgit v1.2.1