From 5a24685f76d70dc3d1dcb1a686d703bcb5e32e22 Mon Sep 17 00:00:00 2001 From: Jonghwa Lee Date: Mon, 2 Dec 2024 10:51:27 +0900 Subject: [PATCH] [tools/mec] Read const_element_count_limit from setting (#14382) 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 --- .../model_explorer_circle/src/model_explorer_circle/main.py | 5 +++++ 1 file changed, 5 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 6d0681728d3..31f8442b55a 100644 --- a/tools/model_explorer_circle/src/model_explorer_circle/main.py +++ b/tools/model_explorer_circle/src/model_explorer_circle/main.py @@ -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.""" @@ -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)