diff --git a/tensorflow/lite/kernels/internal/reference/concatenation.h b/tensorflow/lite/kernels/internal/reference/concatenation.h index f587cfd1c9c..b511826969b 100644 --- a/tensorflow/lite/kernels/internal/reference/concatenation.h +++ b/tensorflow/lite/kernels/internal/reference/concatenation.h @@ -18,6 +18,7 @@ limitations under the License. #include "tensorflow/lite/kernels/internal/common.h" #include "tensorflow/lite/kernels/internal/compatibility.h" +#include "tensorflow/lite/kernels/internal/round.h" #include "tensorflow/lite/kernels/internal/types.h" namespace tflite { @@ -121,9 +122,9 @@ inline void ConcatenationWithScaling(const ConcatenationParams& params, const float scale = input_scale[i] * inverse_output_scale; const float bias = -input_zeropoint[i] * scale; for (int j = 0; j < copy_size; ++j) { - const int32_t value = - static_cast(std::round(input_ptr[j] * scale + bias)) + - output_zeropoint; + const int32_t value = static_cast(tflite::TfLiteRound( + input_ptr[j] * scale + bias)) + + output_zeropoint; output_ptr[j] = static_cast( std::max(std::min(255, value), 0)); }