From 7a58fcc4f33a143b25c3753895bc4fffa6cc40c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=ED=95=9C=EC=A2=85/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84?= =?utf8?q?=EC=9E=90?= Date: Fri, 11 May 2018 15:12:28 +0900 Subject: [PATCH] [tflite_run] Dump input tensors (#1175) Dump input tensors with output tensors since the output tensors are depend on input tensors. The loader's behavior is still valid without changes. Signed-off-by: Hanjoung Lee --- tools/tflite_run/src/tensor_dumper.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/tflite_run/src/tensor_dumper.cc b/tools/tflite_run/src/tensor_dumper.cc index c40d49b..bb52b6c 100644 --- a/tools/tflite_run/src/tensor_dumper.cc +++ b/tools/tflite_run/src/tensor_dumper.cc @@ -18,7 +18,9 @@ void TensorDumper::dump(const std::string &filename) const // TODO Handle file open/write error std::ofstream file(filename, std::ios::out | std::ios::binary); - const auto &indices = _interpreter.outputs(); + // Concat inputs and outputs + std::vector indices = _interpreter.inputs(); + indices.insert(indices.end(), _interpreter.outputs().begin(), _interpreter.outputs().end()); // Write number of tensors uint32_t num_tensors = static_cast(indices.size()); -- 2.7.4