Skip to content

Commit 3df4bc0

Browse files
authored
documentation (#12)
* documentation * fix try * doc
1 parent 3352388 commit 3df4bc0

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

_doc/api/export/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ onnx_diagnostic.export
1010
ModelInputs
1111
+++++++++++
1212

13-
.. autoclass:: onnx_diagnostic.dyanmic_shapes.ModelInputs
13+
.. autoclass:: onnx_diagnostic.export.ModelInputs
1414
:members:
1515

1616
Other functions

_doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
("py:class", "transformers.cache_utils.MambaCache"),
122122
("py:func", "torch.export._draft_export.draft_export"),
123123
("py:func", "torch._export.tools.report_exportability"),
124+
("py:meth", "transformers.GenerationMixin.generate"),
124125
]
125126

126127
nitpick_ignore_regex = [

_doc/examples/plot_export_tiny_llm.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ def _forward_(*args, _f=None, **kwargs):
113113

114114
print("result type", string_type(expected_output, with_shape=True))
115115

116-
ep = torch.export.export(
117-
untrained_model, (), kwargs=cloned_inputs, dynamic_shapes=dynamic_shapes
118-
)
119-
120116
# %%
121117
# It works.
122118
#

_doc/examples/plot_export_with_dynamic_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Export with DynamicCache and dynamic shapes
66
===========================================
77
8-
Every LLMs implemented in :epkg:`trasnformers` use cache.
8+
Every LLMs implemented in :epkg:`transformers` use cache.
99
One of the most used is :class:`transformers.cache_utils.DynamicCache`.
1010
The cache size is dynamic to cope with the growing context.
1111
The example shows a tool which determines the dynamic shapes

onnx_diagnostic/export/dynamic_shapes.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ def forward(self, x, y):
4545
ds = mi.guess_dynamic_shapes()
4646
pprint.pprint(ds)
4747
48-
import pprint
49-
import torch
50-
from onnx_diagnostic.export import ModelInputs
51-
5248
**kwargs**
5349
5450
.. runpython::
5551
:showcode:
5652
53+
import pprint
54+
import torch
55+
from onnx_diagnostic.export import ModelInputs
56+
5757
class Model(torch.nn.Module):
5858
def forward(self, x, y):
5959
return x + y
@@ -69,15 +69,15 @@ def forward(self, x, y):
6969
ds = mi.guess_dynamic_shapes()
7070
pprint.pprint(ds)
7171
72-
import pprint
73-
import torch
74-
from onnx_diagnostic.export import ModelInputs
75-
7672
**and and kwargs**
7773
7874
.. runpython::
7975
:showcode:
8076
77+
import pprint
78+
import torch
79+
from onnx_diagnostic.export import ModelInputs
80+
8181
class Model(torch.nn.Module):
8282
def forward(self, x, y):
8383
return x + y

0 commit comments

Comments
 (0)