Skip to content

Commit

Permalink
[tools/mec] Read const_element_count_limit from setting (#14382)
Browse files Browse the repository at this point in the history
The value of 'const_element_count_limit' will be used to determine
number of data in tensor to be shown.

ONE-DCO-1.0-Signed-off-by: Jonghwa Lee <[email protected]>
  • Loading branch information
batcheu authored Dec 2, 2024
1 parent 39c39a3 commit 5a24685
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 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 @@ -40,6 +40,8 @@ def __init__(self):
v: k
for k, v in circle_schema.TensorType.__dict__.items()
}
# Number of elements to show in tensor values (default: 16)
self.const_element_count_limit = 16

def load_model(self, model_path: str) -> None:
"""Load the model from the given path."""
Expand Down Expand Up @@ -179,6 +181,9 @@ def convert(self, model_path: str, settings: Dict) -> ModelExplorerGraphs:
"""Convert the model to a set of graphs."""
graph = graph_builder.Graph(id='main')

if settings.get('const_element_count_limit'):
self.const_element_count_limit = settings['const_element_count_limit']

self.load_model(model_path)
self.build_graph(graph)

Expand Down

0 comments on commit 5a24685

Please sign in to comment.