diff --git a/tensorflow/lite/kernels/activations.cc b/tensorflow/lite/kernels/activations.cc index cd16bccc062..bf1ff8d50d7 100644 --- a/tensorflow/lite/kernels/activations.cc +++ b/tensorflow/lite/kernels/activations.cc @@ -430,15 +430,15 @@ TfLiteStatus TanhPrepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, output->params.zero_point, 0); int input_scale_log2_rounded; - bool paramScalePOT = + bool param_scale_pot = CheckedLog2(input->params.scale, &input_scale_log2_rounded); data->input_left_shift = (15 - kInputIntegerBits) + input_scale_log2_rounded; - paramScalePOT &= + param_scale_pot &= (data->input_left_shift == 0 || data->input_left_shift == 1); - if (!paramScalePOT) { + if (!param_scale_pot) { // In case of general scale parameter, we need to do a rescaling. // Magic constant 4096: // We need to scale down to (-2^3, 2^3) / 3 is kInputIntegerBits/ interval @@ -526,14 +526,14 @@ TfLiteStatus SigmoidPrepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, output->params.zero_point, 0); int input_scale_log2_rounded; - bool paramScalePOT = + bool param_scale_pot = CheckedLog2(input->params.scale, &input_scale_log2_rounded); data->input_left_shift = (15 - kInputIntegerBits) + input_scale_log2_rounded; - paramScalePOT &= (data->input_left_shift == 0); + param_scale_pot &= (data->input_left_shift == 0); - if (!paramScalePOT) { + if (!param_scale_pot) { // In case of general scale parameter, we need to do a rescaling. // Magic constant 4096: // We need to scale down to (-2^3, 2^3) / 3 is kInputIntegerBits/ interval diff --git a/tensorflow/lite/kernels/internal/reference/integer_ops/logistic.h b/tensorflow/lite/kernels/internal/reference/integer_ops/logistic.h index 39654e542f2..e315683c0cd 100644 --- a/tensorflow/lite/kernels/internal/reference/integer_ops/logistic.h +++ b/tensorflow/lite/kernels/internal/reference/integer_ops/logistic.h @@ -66,7 +66,7 @@ inline void Logistic(int32_t input_multiplier, int32_t input_size, int32_t input_data_mul = (input_multiplier > 0) ? input_multiplier : 1; for (int i = 0; i < input_size; ++i, ptr_input_data++, ptr_output_data++) { - int32_t input_data = (*ptr_input_data)*input_data_mul; + int32_t input_data = (*ptr_input_data) * input_data_mul; // Scale by 3/4 to expand range [-8,8]->[-10.7,10.7] and // we do interpolation on unsigned values. diff --git a/tensorflow/lite/kernels/internal/reference/integer_ops/tanh.h b/tensorflow/lite/kernels/internal/reference/integer_ops/tanh.h index 58e36f955d0..baae65ab30e 100644 --- a/tensorflow/lite/kernels/internal/reference/integer_ops/tanh.h +++ b/tensorflow/lite/kernels/internal/reference/integer_ops/tanh.h @@ -66,7 +66,7 @@ inline void Tanh(int32_t input_multiplier, int32_t input_left_shift, int32_t input_data_mul = (input_multiplier > 0) ? input_multiplier : 1; for (int i = 0; i < input_size; ++i, ptr_input_data++, ptr_output_data++) { - int32_t input_data = (*ptr_input_data)*input_data_mul; + int32_t input_data = (*ptr_input_data) * input_data_mul; if (input_left_shift == 1) { input_data <<= 1;