From d38908150825becd01e939ad56013155ffc55512 Mon Sep 17 00:00:00 2001 From: luxupu <7809871+luxupu@users.noreply.github.com> Date: Tue, 5 Mar 2019 23:40:50 -0800 Subject: [PATCH] Remove unnecessary cast The cast to int32 is not needed here. --- .../lite/kernels/internal/reference/integer_ops/softmax.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tensorflow/lite/kernels/internal/reference/integer_ops/softmax.h b/tensorflow/lite/kernels/internal/reference/integer_ops/softmax.h index 3f6bf1cb73e..fe17ffa991d 100644 --- a/tensorflow/lite/kernels/internal/reference/integer_ops/softmax.h +++ b/tensorflow/lite/kernels/internal/reference/integer_ops/softmax.h @@ -85,9 +85,8 @@ inline void Softmax(const SoftmaxParams& params, (shifted_scale * exp_in_0).raw(), num_bits_over_unit + 31 - 8); const int32 shifted_output = unsat_output - 128; - output_data[i * depth + c] = static_cast( - std::max(std::min(shifted_output, static_cast(127)), - static_cast(-128))); + output_data[i * depth + c] = + static_cast(std::max(std::min(shifted_output, 127),-128)); } else { output_data[i * depth + c] = -128;