Skip to content

Commit bd669f9

Browse files
committed
fix documentation
1 parent 8dfe56e commit bd669f9

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

_doc/examples/plot_export_tiny_llm_dim01_onnx.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,13 @@ def validation(ep, input_sets, expected, catch_exception=True):
128128
ep.model_proto.SerializeToString(), providers=["CPUExecutionProvider"]
129129
)
130130
for k, v in input_sets.items():
131-
feeds = make_feeds(sess, torch_deepcopy(v), use_numpy=True)
131+
try:
132+
feeds = make_feeds(sess, torch_deepcopy(v), use_numpy=True)
133+
except Exception as e:
134+
if not catch_exception:
135+
raise
136+
yield k, e
137+
continue
132138
try:
133139
got = sess.run(None, feeds)
134140
except Exception as e:

_doc/examples/plot_export_tiny_llm_dim01_onnx_custom.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,13 @@ def validation(onx, input_sets, expected, catch_exception=True):
146146
onx.SerializeToString(), providers=["CPUExecutionProvider"]
147147
)
148148
for k, v in input_sets.items():
149-
feeds = make_feeds(sess, torch_deepcopy(v), use_numpy=True)
149+
try:
150+
feeds = make_feeds(sess, torch_deepcopy(v), use_numpy=True)
151+
except Exception as e:
152+
if not catch_exception:
153+
raise
154+
yield k, e
155+
continue
150156
try:
151157
got = sess.run(None, feeds)
152158
except Exception as e:

onnx_diagnostic/helpers/mini_onnx_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def _unflatten(
485485
try:
486486
return pos + 1, torch.from_numpy(outputs[pos]).to(device)
487487
except TypeError:
488-
# it shuold be more robusts
488+
# it should be more robust
489489
import ml_dtypes
490490

491491
if outputs[pos].dtype == ml_dtypes.bfloat16:

0 commit comments

Comments
 (0)