Skip to content

Commit 5cbe8e5

Browse files
committed
Improves onnx_simple_text_plot
1 parent d83ff4e commit 5cbe8e5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

onnx_array_api/plotting/text_plot.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,10 @@ def str_node(indent, node):
824824
rows.append(f"opset: domain={opset.domain!r} version={opset.version!r}")
825825
if hasattr(model, "graph"):
826826
if model.doc_string:
827-
rows.append(f"doc_string: {model.doc_string}")
827+
if len(model.doc_string) < 55:
828+
rows.append(f"doc_string: {model.doc_string}")
829+
else:
830+
rows.append(f"doc_string: {model.doc_string[:55]}...")
828831
main_model = model
829832
model = model.graph
830833
else:
@@ -1044,7 +1047,10 @@ def _mark_link(rows, lengths, r1, r2, d):
10441047
for fct in main_model.functions:
10451048
rows.append(f"----- function name={fct.name} domain={fct.domain}")
10461049
if fct.doc_string:
1047-
rows.append(f"----- doc_string: {fct.doc_string}")
1050+
if len(fct.doc_string) < 55:
1051+
rows.append(f"----- doc_string: {fct.doc_string}")
1052+
else:
1053+
rows.append(f"----- doc_string: {fct.doc_string[:55]}...")
10481054
res = onnx_simple_text_plot(
10491055
fct,
10501056
verbose=verbose,

0 commit comments

Comments
 (0)