From cbf4d553e123a9fa7a92072aea61edcf50ed6c32 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 4 Sep 2020 20:51:24 +0100 Subject: COMPMID-3755: Resize failing on input with trailing 1's Base the dimensions of the valid region generated by the reshape kernel on the output shape dimensions. This allows correct scaling on inputs that are in NHWC format and have width and height equal to 1 e.g. 1x1x32. Underlying problem causing this issue is the fact that Compute Library removes trailing 1's of a given shape. Signed-off-by: Georgios Pinitas Change-Id: Icfdafc469214840998e7c198b33f7358d566d2e7 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3924 Tested-by: Arm Jenkins Reviewed-by: Sang-Hoon Park Comments-Addressed: Arm Jenkins --- src/core/Helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Helpers.cpp b/src/core/Helpers.cpp index 5c7200b35c..6701ff4483 100644 --- a/src/core/Helpers.cpp +++ b/src/core/Helpers.cpp @@ -246,7 +246,7 @@ ValidRegion calculate_valid_region_scale(const ITensorInfo &src_info, const Tens } // Setup output valid region - ValidRegion valid_region{ Coordinates(), dst_shape, src_info.tensor_shape().num_dimensions() }; + ValidRegion valid_region{ Coordinates(), dst_shape, dst_shape.num_dimensions() }; valid_region.anchor.set(idx_width, std::max(0, valid_start_out_x)); valid_region.anchor.set(idx_height, std::max(0, valid_start_out_y)); -- cgit v1.2.1