From 1856ff7ebb29e04c3549b74d7ced336111cbf05e Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Fri, 7 Feb 2020 13:46:45 +0000 Subject: COMPMID-3097 Fuse activation with fully connected layer CL Change-Id: I447030e69b9e565f2f81529a41af8c5e7ece7ecf Signed-off-by: Giorgio Arena Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2702 Comments-Addressed: Arm Jenkins Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins --- .../NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp') diff --git a/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp b/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp index d24089d615..b8ca17ec3d 100644 --- a/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 ARM Limited. + * Copyright (c) 2019-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -46,8 +46,7 @@ namespace Status validate_arguments(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, int min, int max) { ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::S32); - ARM_COMPUTE_RETURN_ERROR_ON(max > 127); - ARM_COMPUTE_RETURN_ERROR_ON(min < -128 || min > max); + ARM_COMPUTE_RETURN_ERROR_ON(min > max); // Check biases if exist if(bias != nullptr) @@ -222,7 +221,7 @@ void NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel::configure(const I INEKernel::configure(win_config.second); // Check if we need to clamp the result using min and max - const bool is_bounded_relu = ((min != max) && !(min == -128 && max == 127)); + const bool is_bounded_relu = !(min <= -128 && max >= 127); _func = is_bounded_relu ? &NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel::run : &NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel::run; } -- cgit v1.2.1