From 80838f166ee1d6eb152dc85f21642157b80301c0 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 12 Dec 2019 18:23:13 +0000 Subject: COMPMID-2819: Avoid overflows in pooling shape calculation Pooling shape calculator was performing operations in the unsigned domain leading to overflows in irregular shapes. Thus, we perform all operations in the signed domain and we get the maximum between the given shape and 1, returning always a valid tensor. Signed-off-by: Georgios Pinitas Change-Id: Ia95d7e54929c8bc29e99dc80a61065e403b29a94 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2467 Tested-by: Arm Jenkins Reviewed-by: Giorgio Arena Comments-Addressed: Arm Jenkins --- arm_compute/core/Utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arm_compute/core/Utils.h') diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h index a2c18bb205..22a1e7064d 100644 --- a/arm_compute/core/Utils.h +++ b/arm_compute/core/Utils.h @@ -943,8 +943,8 @@ std::pair deconvolution_output_dimensions(unsigned i * * @return A pair with the new width in the first position and the new height in the second. */ -std::pair scaled_dimensions(unsigned int width, unsigned int height, - unsigned int kernel_width, unsigned int kernel_height, +std::pair scaled_dimensions(int width, int height, + int kernel_width, int kernel_height, const PadStrideInfo &pad_stride_info, const Size2D &dilation = Size2D(1U, 1U)); -- cgit v1.2.1