diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-12-12 18:23:13 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-02-12 13:50:24 +0000 |
commit | 80838f166ee1d6eb152dc85f21642157b80301c0 (patch) | |
tree | 99cd7e0d85de12f1f9201ab76cc43b38af262884 /arm_compute/core | |
parent | 9bd49f979907fdef82a50f64a486c5d69df7ae39 (diff) | |
download | ComputeLibrary-80838f166ee1d6eb152dc85f21642157b80301c0.tar.gz |
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 <georgios.pinitas@arm.com>
Change-Id: Ia95d7e54929c8bc29e99dc80a61065e403b29a94
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2467
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core')
-rw-r--r-- | arm_compute/core/Utils.h | 4 |
1 files changed, 2 insertions, 2 deletions
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<unsigned int, unsigned int> 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<unsigned int, unsigned int> scaled_dimensions(unsigned int width, unsigned int height, - unsigned int kernel_width, unsigned int kernel_height, +std::pair<unsigned int, unsigned int> scaled_dimensions(int width, int height, + int kernel_width, int kernel_height, const PadStrideInfo &pad_stride_info, const Size2D &dilation = Size2D(1U, 1U)); |