diff --git a/kernels/c_model/c_khr_nn.c b/kernels/c_model/c_khr_nn.c index 7e29227..a8042b2 100644 --- a/kernels/c_model/c_khr_nn.c +++ b/kernels/c_model/c_khr_nn.c @@ -508,7 +508,8 @@ void PoolingKernelImpl( if (!max_pooling) { //result = conversion_24_8(result / (int16_t)(size_x * size_y)); - result = CLAMP(result / (size_x * size_y), getMinValue(fmt), getMaxValue(fmt)); + result = result / (size_x * size_y); + result = CLAMP(result, getMinValue(fmt), getMaxValue(fmt)); } const size_t output_byte_offset =