From cbede286da8711031fb6fc56bb2e2c246a4c5455 Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Mon, 12 Oct 2020 21:44:23 +0100 Subject: COMPMID-3828: fix unsigned overflow in quantized reduce mean Change-Id: I9d3122b4858137d422548d1d417eb04a27ae9c7b Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4143 Reviewed-by: Michele Di Giorgio Reviewed-by: TeresaARM Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- src/core/NEON/kernels/NEReductionOperationKernel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/NEON/kernels/NEReductionOperationKernel.cpp') diff --git a/src/core/NEON/kernels/NEReductionOperationKernel.cpp b/src/core/NEON/kernels/NEReductionOperationKernel.cpp index 9eebb42151..9af7f2ab10 100644 --- a/src/core/NEON/kernels/NEReductionOperationKernel.cpp +++ b/src/core/NEON/kernels/NEReductionOperationKernel.cpp @@ -1459,7 +1459,7 @@ struct RedOpYZW_quantized case ReductionOperation::MEAN_SUM: { int32_t res = static_cast(res_value); - res /= in_info.dimension(axis); + res /= static_cast(in_info.dimension(axis)); *reinterpret_cast(output.ptr() + x) = utils::cast::saturate_cast(res); break; } -- cgit v1.2.1