diff options
Diffstat (limited to 'tensorflow/contrib/lite/kernels/svdf.cc')
-rw-r--r-- | tensorflow/contrib/lite/kernels/svdf.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/contrib/lite/kernels/svdf.cc b/tensorflow/contrib/lite/kernels/svdf.cc index 43ac3a2ce8..6d4912ce3a 100644 --- a/tensorflow/contrib/lite/kernels/svdf.cc +++ b/tensorflow/contrib/lite/kernels/svdf.cc @@ -16,7 +16,6 @@ limitations under the License. // SVDF op that compresses a fully connected op via low-rank matrix // factorization. See https://research.google.com/pubs/archive/43813.pdf for // details. -#include <unistd.h> #include <cassert> #include <cmath> #include <cstdio> @@ -105,7 +104,7 @@ constexpr int kStateTensor = 0; constexpr int kOutputTensor = 1; void* Init(TfLiteContext* context, const char* buffer, size_t length) { - auto* op_data = new OpData; + auto* op_data = new OpData(); op_data->float_weights_time_initialized = false; context->AddTensors(context, /*tensors_to_add=*/4, &op_data->scratch_tensor_index); @@ -382,11 +381,12 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { // the Eval function. // TODO(alanchiao): refactor logic out into dequantize function. if (!op_data->float_weights_time_initialized) { - const float inv_scale = 1.0 / weights_time->params.scale; + const float dequantization_scale = weights_time->params.scale; const int8_t* weights_time_ptr = reinterpret_cast<int8_t*>(weights_time->data.uint8); for (int i = 0; i < NumElements(float_weights_time); ++i) { - float_weights_time->data.f[i] = weights_time_ptr[i] * inv_scale; + float_weights_time->data.f[i] = + weights_time_ptr[i] * dequantization_scale; } op_data->float_weights_time_initialized = true; } |