Skip to content

Commit f738021

Browse files
authored
fix documentation (#300)
* fix documentation * doc
1 parent 8dfe56e commit f738021

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
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: 2 additions & 2 deletions
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:
@@ -589,7 +589,7 @@ def create_input_tensors_from_onnx_model(
589589
590590
See example :ref:`l-plot-intermediate-results` for an example.
591591
592-
.. code-bloc:: python
592+
.. code-block:: python
593593
594594
import os
595595
from onnx_diagnostic.helpers.mini_onnx_builder import (

0 commit comments

Comments
 (0)