From 3601789e4d4a6fcea8a3f4cd660daf2fd80e9765 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EA=B9=80=EC=9A=A9=EC=84=AD/=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: Tue, 20 Nov 2018 11:03:54 +0900 Subject: [PATCH] [model_parser] Fix wrong printing type of tensor (#3635) * [model_parser] Fix wrong printing type of tensor Fixes wrong printing type of tensor. The type names like FLOAT32, UINT8 not 0 should be printed. Signed-off-by: Yongseop Kim * Fix to get type_name from tensor_wrapping --- tools/tflitefile_tool/tensor_printer.py | 2 +- tools/tflitefile_tool/tensor_wrapping.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/tflitefile_tool/tensor_printer.py b/tools/tflitefile_tool/tensor_printer.py index d57b40f..de2f48e 100644 --- a/tools/tflitefile_tool/tensor_printer.py +++ b/tools/tflitefile_tool/tensor_printer.py @@ -35,7 +35,7 @@ class TensorPrinter(object): if (self.tensor.tf_buffer.DataLength() == 0): isEmpty = " Empty" shape_str = self.GetShapeString() - type_name = self.tensor.tf_tensor.Type() + type_name = self.tensor.type_name shape_name = "" if self.tensor.tf_tensor.Name() != 0: diff --git a/tools/tflitefile_tool/tensor_wrapping.py b/tools/tflitefile_tool/tensor_wrapping.py index b0639bb..bc376a1 100755 --- a/tools/tflitefile_tool/tensor_wrapping.py +++ b/tools/tflitefile_tool/tensor_wrapping.py @@ -35,3 +35,4 @@ class Tensor(object): self.tensor_idx = tensor_idx self.tf_tensor = tf_tensor self.tf_buffer = tf_buffer + self.type_name = TensorTypeList[self.tf_tensor.Type()] -- 2.7.4