From 3db3feb6e4e023ab990958aa145a28db82683d0d Mon Sep 17 00:00:00 2001 From: Jonghwa Lee Date: Fri, 17 Jan 2025 12:50:19 +0900 Subject: [PATCH] [tools/mec] Add value attribute only when available (#14561) The tensor buffer can be empty for immature model, so it needs to check if the buffer is available when it tries to fill value attribute. ONE-DCO-1.0-Signed-off-by: Jonghwa Lee --- tools/model_explorer_circle/src/model_explorer_circle/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/model_explorer_circle/src/model_explorer_circle/main.py b/tools/model_explorer_circle/src/model_explorer_circle/main.py index dde38d93a85..d1f3bb504c6 100644 --- a/tools/model_explorer_circle/src/model_explorer_circle/main.py +++ b/tools/model_explorer_circle/src/model_explorer_circle/main.py @@ -122,6 +122,8 @@ def add_tensor_value_attribute(self, me_node: graph_builder.GraphNode, """Prints a tensor with the specified number of elements""" tensor = self.model.subgraphs[0].tensors[tensor_id] buffer = self.model.buffers[tensor.buffer].data + if buffer is None: + return dtype = self.dict_tensor_type_to_string[tensor.type].lower() # Convert buffer into numpy array with the correct datatype if dtype in ['int4', 'uint4']: