summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/tflitefile_tool/model_printer.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/tflitefile_tool/model_printer.py b/tools/tflitefile_tool/model_printer.py
index ad06fa7a7..fda029143 100644
--- a/tools/tflitefile_tool/model_printer.py
+++ b/tools/tflitefile_tool/model_printer.py
@@ -134,9 +134,12 @@ 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)))