summaryrefslogtreecommitdiff
path: root/tools/tflitefile_tool/model_printer.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tflitefile_tool/model_printer.py')
-rw-r--r--tools/tflitefile_tool/model_printer.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/tflitefile_tool/model_printer.py b/tools/tflitefile_tool/model_printer.py
index ad06fa7a7..0c11d01bd 100644
--- a/tools/tflitefile_tool/model_printer.py
+++ b/tools/tflitefile_tool/model_printer.py
@@ -134,9 +134,13 @@ class ModelPrinter(object):
def PrintTotalMemory(self):
total_memory = 0
+ filled_memory = 0 # only memory for constant
for tensor in self.op_parser.GetAllTensors():
+ if tensor.tf_buffer.DataLength() != 0:
+ filled_memory += tensor.memory_size
total_memory += tensor.memory_size
from tensor_printer import ConvertBytesToHuman
- print("Expected total memory for allocating all tensors: {0}".format(
- ConvertBytesToHuman(total_memory)))
+ print("Expected TOTAL memory: {0}".format(ConvertBytesToHuman(total_memory)))
+ print("Expected FILLED memory: {0}".format(ConvertBytesToHuman(filled_memory)))
+ print('')