From 44430e7ddab9b9e80d4b9dde7c7f1bcf7d85d690 Mon Sep 17 00:00:00 2001 From: Robert David Date: Thu, 26 Mar 2020 10:55:13 -0700 Subject: [PATCH] Nit: Create op_params in the smallest scope. PiperOrigin-RevId: 303149266 Change-Id: I4f98d0dfcfbee6da5bcc5b4fa85b3e17205df481 --- tensorflow/lite/micro/kernels/dequantize.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tensorflow/lite/micro/kernels/dequantize.cc b/tensorflow/lite/micro/kernels/dequantize.cc index 8235924bcb6..7f25493dab4 100644 --- a/tensorflow/lite/micro/kernels/dequantize.cc +++ b/tensorflow/lite/micro/kernels/dequantize.cc @@ -49,11 +49,10 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(context, node, 0); - tflite::DequantizationParams op_params; - op_params.zero_point = input->params.zero_point; - op_params.scale = static_cast(input->params.scale); - if (output->type == kTfLiteFloat32) { + tflite::DequantizationParams op_params; + op_params.zero_point = input->params.zero_point; + op_params.scale = static_cast(input->params.scale); switch (input->type) { case kTfLiteUInt8: reference_ops::Dequantize(