From 45e489aafeded6b49c1441606aefd6369e2ab799 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 28 Feb 2019 13:40:29 +0900 Subject: [PATCH] Fix tflite_run tensor loader bug (#4533) Fix tflite_run tensor loader's raw data pointer type: unique_ptr of array Signed-off-by: Hyeongseok Oh --- tests/tools/tflite_run/src/tensor_loader.cc | 2 +- tests/tools/tflite_run/src/tensor_loader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tools/tflite_run/src/tensor_loader.cc b/tests/tools/tflite_run/src/tensor_loader.cc index 934b78f..b105005 100644 --- a/tests/tools/tflite_run/src/tensor_loader.cc +++ b/tests/tools/tflite_run/src/tensor_loader.cc @@ -28,7 +28,7 @@ void TensorLoader::load(const std::string &filename) file.read(reinterpret_cast(tensor_indices_raw), sizeof(tensor_indices_raw)); std::vector tensor_indices(tensor_indices_raw, tensor_indices_raw + num_tensors); - _raw_data = std::unique_ptr(new float[file_size]); + _raw_data = std::unique_ptr(new float[file_size]); file.read(reinterpret_cast(_raw_data.get()), file_size); size_t offset = 0; diff --git a/tests/tools/tflite_run/src/tensor_loader.h b/tests/tools/tflite_run/src/tensor_loader.h index fc4a37a..7b46a1a 100644 --- a/tests/tools/tflite_run/src/tensor_loader.h +++ b/tests/tools/tflite_run/src/tensor_loader.h @@ -26,7 +26,7 @@ public: private: tflite::Interpreter &_interpreter; - std::unique_ptr _raw_data; + std::unique_ptr _raw_data; std::unordered_map> _tensor_map; }; -- 2.7.4