Skip to content

Commit

Permalink
[tools/mec] Add value attribute only when available (Samsung#14561)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
batcheu authored and chenyx113 committed Jan 18, 2025
1 parent 99ca84c commit 3db3feb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/model_explorer_circle/src/model_explorer_circle/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand Down

0 comments on commit 3db3feb

Please sign in to comment.