Skip to content

Commit 332a3f5

Browse files
authored
better doc (#4)
1 parent 67ca863 commit 332a3f5

File tree

7 files changed

+47
-8
lines changed

7 files changed

+47
-8
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
onnx_diagnostic.torch_export_patches
22
====================================
33

4+
.. toctree::
5+
:maxdepth: 1
6+
:caption: submodules
7+
8+
patches/index
9+
410
.. automodule:: onnx_diagnostic.torch_export_patches
511
:members:
612
:no-undoc-members:
13+
14+
.. autofunction:: onnx_diagnostic.torch_export_patches.bypass_export_some_errors
15+
16+
.. autofunction:: onnx_diagnostic.torch_export_patches.register_additional_serialization_functions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
onnx_diagnostic.torch_export_patches.patches
2+
============================================
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
:caption: modules
7+
8+
patch_torch
9+
patch_transformers
10+
11+
.. automodule:: onnx_diagnostic.torch_export_patches.patches
12+
:members:
13+
:no-undoc-members:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
onnx_diagnostic.torch_export_patches.patches.patch_torch
3+
========================================================
4+
5+
.. automodule:: onnx_diagnostic.torch_export_patches.patches.patch_torch
6+
:members:
7+
:undoc-members:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
onnx_diagnostic.torch_export_patches.patches.patch_transformers
2+
===============================================================
3+
4+
.. automodule:: onnx_diagnostic.torch_export_patches.patches.patch_transformers
5+
:members:
6+
:undoc-members:

_doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"numpy": ("https://numpy.org/doc/stable", None),
8787
"onnx": ("https://onnx.ai/onnx/", None),
8888
"onnx_array_api": ("https://sdpython.github.io/doc/onnx-array-api/dev/", None),
89+
"onnx_diagnostic": ("https://sdpython.github.io/doc/onnx-diagnostic/dev/", None),
8990
"onnx_extended": ("https://sdpython.github.io/doc/onnx-extended/dev/", None),
9091
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
9192
"python": (f"https://docs.python.org/{sys.version_info.major}", None),

_doc/examples/plot_export_tiny_llm.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,10 @@ def _forward_(*args, _f=None, **kwargs):
6767
# The model creation
6868
# ++++++++++++++++++
6969
#
70-
# Let's create an untrained model.
71-
72-
73-
# %%
74-
# Let's get the model, inputs and dynamic shapes.
70+
# Let's create an untrained model using the config file provided
71+
# `config.json <https://huggingface.co/arnir0/Tiny-LLM/blob/main/config.json>`_
72+
# to create an untrained model: :func:`onnx_diagnostic.torch_models.llms.get_tiny_llm`.
73+
# Then let's use it.
7574

7675
experiment = get_tiny_llm()
7776
untrained_model, inputs, dynamic_shapes = (
@@ -88,12 +87,15 @@ def _forward_(*args, _f=None, **kwargs):
8887

8988

9089
# %% Let's run it.
91-
print("input type", string_type(inputs, with_shape=True))
90+
print("input type before", string_type(inputs, with_shape=True))
9291

9392
expected_output = untrained_model(**inputs)
9493

94+
print("input type after-", string_type(inputs, with_shape=True))
95+
96+
# %%
97+
# The outputs
9598

96-
print("input after the execution", string_type(inputs, with_shape=True))
9799
print("result type", string_type(expected_output, with_shape=True))
98100

99101
ep = torch.export.export(

onnx_diagnostic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
Functions, classes to dig into a model when this one is right, slow, wrong...
44
"""
55

6-
__version__ = "0.1.0"
6+
__version__ = "0.2.0"
77
__author__ = "Xavier Dupré"

0 commit comments

Comments
 (0)