diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-12-10 18:45:35 +0000 |
---|---|---|
committer | Pablo Marquez <pablo.tello@arm.com> | 2018-12-14 15:27:18 +0000 |
commit | b4af2c6738614850aaca3754904f0e8e3b17f0b2 (patch) | |
tree | a2d234a99d0599c325311c73a4e4f2df019eb3ee /arm_compute/core/utils/misc | |
parent | bf9731edfa0439cad4d70efc3065e71e199c62b8 (diff) | |
download | ComputeLibrary-b4af2c6738614850aaca3754904f0e8e3b17f0b2.tar.gz |
COMPMID-1710: Fixes in StrideSlice calculations.
Change-Id: I66eb922f1ff15142de278bf4439a61c979f98ba7
Reviewed-on: https://review.mlplatform.org/382
Reviewed-by: Matthew Bentham <matthew.bentham@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Diffstat (limited to 'arm_compute/core/utils/misc')
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index f41d00f54d..adf5309ea5 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -668,15 +668,16 @@ inline TensorShape compute_strided_slice_shape(const ITensorInfo &input, int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask) { using namespace arm_compute::helpers::tensor_transform; + return compute_strided_slice_output_shape(input.tensor_shape(), starts, ends, strides, begin_mask, end_mask, shrink_axis_mask); +} - const TensorShape &input_shape = input.tensor_shape(); - - // Get actual start, end coordinates and strides - const Coordinates final_strides = strided_slice_strides(input_shape, strides); - const Coordinates starts_abs = strided_slice_absolute_start_coords(input_shape, starts, final_strides, begin_mask); - const Coordinates ends_abs = strided_slice_absolute_end_coords(input_shape, starts_abs, ends, final_strides, end_mask, shrink_axis_mask); +inline TensorShape compute_slice_shape(const TensorShape &input_shape, const Coordinates &starts, const Coordinates &ends) +{ + using namespace arm_compute::helpers::tensor_transform; - return compute_strided_slice_output_shape(input_shape, starts_abs, ends_abs, final_strides); + return compute_strided_slice_output_shape(input_shape, + starts, ends, BiStrides(), + 0, construct_slice_end_mask(ends), 0); } inline TensorShape compute_batch_to_space_shape(const ITensorInfo *input, const int block_x, const int block_y) |