diff options
author | SiCong Li <sicong.li@arm.com> | 2020-11-08 21:58:01 +0000 |
---|---|---|
committer | SiCong Li <sicong.li@arm.com> | 2020-11-09 10:21:44 +0000 |
commit | 18bdfaefd3aeb2557c2e484b67b06c515f9a120f (patch) | |
tree | 82451702f8651445daa8ab0d91a52d9b0c10339d /arm_compute/core/utils | |
parent | 0ea50e3233c0b20a3e3c68e42bdff31565cefa3d (diff) | |
download | ComputeLibrary-18bdfaefd3aeb2557c2e484b67b06c515f9a120f.tar.gz |
COMPMID-3951 LargeGraph_FLOAT32_Rank4_25 CTS failures in Android Q in CL Fix1
* Fix CLSpaceToBatchLayerKernel and NESpaceToBatchLayerKernel validation
errors by using the correctly calculated output tensor shape
Signed-off-by: SiCong Li <sicong.li@arm.com>
Change-Id: I21d61f870e6a23a2e38dcb95c939b0bf08082b6f
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4347
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-by: TeresaARM <teresa.charlinreyes@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/utils')
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index 72b7675749..5ed8aea277 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -1157,9 +1157,12 @@ inline TensorShape compute_space_to_batch_shape(const ITensorInfo *input, const const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); const int idx_batch = get_data_layout_dimension_index(data_layout, DataLayoutDimension::BATCHES); - output_shape.set(idx_width, input->tensor_shape()[idx_width] * block_x + padding_left.x() + padding_right.x()); - output_shape.set(idx_height, input->tensor_shape()[idx_height] * block_y + padding_left.y() + padding_right.y()); - output_shape.set(idx_batch, input->tensor_shape()[idx_batch] / (block_x * block_y)); + ARM_COMPUTE_ERROR_ON((input->tensor_shape()[idx_width] + padding_left.x() + padding_right.x()) % block_x != 0); + ARM_COMPUTE_ERROR_ON((input->tensor_shape()[idx_height] + padding_left.y() + padding_right.y()) % block_y != 0); + + output_shape.set(idx_width, (input->tensor_shape()[idx_width] + padding_left.x() + padding_right.x()) / block_x); + output_shape.set(idx_height, (input->tensor_shape()[idx_height] + padding_left.y() + padding_right.y()) / block_y); + output_shape.set(idx_batch, input->tensor_shape()[idx_batch] * block_x * block_y); return output_shape; } |