1-
1+ ========================================
22onnx-diagnostic: investigate onnx models
33========================================
44
@@ -48,7 +48,7 @@ It also implements tools to investigate, validate exported models (ExportedProgr
4848 license
4949
5050Getting started
51- +++++++++++++++
51+ ===============
5252
5353::
5454
6363 pip install onnx-diagnostic
6464
6565Enlightening Examples
66- +++++++++++++++++++++
66+ =====================
6767
6868**Where to start to export a model **
6969
@@ -85,7 +85,13 @@ Enlightening Examples
8585* :ref: `l-plot-failing-onnxruntime-evaluator `
8686* :ref: `l-plot-failing-model-extract `
8787
88- **Some Usefuls Tools **
88+ Some Usefuls Tools
89+ ==================
90+
91+ string_type
92+ +++++++++++
93+
94+ See :func: `onnx_diagnostic.helpers.string_type `.
8995
9096.. code-block :: python
9197
@@ -107,6 +113,11 @@ Enlightening Examples
107113
108114 >>> (T10s3x4,#2[T10s5x6,T10s5x6x7])
109115
116+ onnx_dtype_name
117+ +++++++++++++++
118+
119+ See :func: `onnx_diagnostic.helpers.onnx_dtype_name `.
120+
110121.. code-block :: python
111122
112123 import onnx
@@ -121,7 +132,64 @@ Enlightening Examples
121132 >>> BFLOAT16
122133 >>> INT64
123134
124- :func: `onnx_diagnostic.helpers.max_diff `, ...
135+ max_diff
136+ ++++++++
137+
138+ See :func: `onnx_diagnostic.helpers.max_diff `.
139+
140+ .. code-block :: python
141+
142+ import torch
143+ from onnx_diagnostic.helpers import max_diff
144+
145+ print (
146+ max_diff(
147+ (torch.Tensor([1 , 2 ]), (torch.Tensor([1 , 2 ]),)),
148+ (torch.Tensor([1 , 2 ]), (torch.Tensor([1 , 2 ]),)),
149+ )
150+ )
151+
152+ ::
153+
154+ >>> {"abs": 0.0, "rel": 0.0, "sum": 0.0, "n": 4.0, "dnan": 0.0}s
155+
156+ guess_dynamic_shapes
157+ ++++++++++++++++++++
158+
159+ See :meth: `onnx_diagnostic.export.ModelInputs.guess_dynamic_shapes `.
160+
161+ .. code-block :: python
162+
163+ inputs = [
164+ (torch.randn((5 , 6 )), torch.randn((1 , 6 ))),
165+ (torch.randn((7 , 8 )), torch.randn((1 , 8 ))),
166+ ]
167+ ds = ModelInputs(model, inputs).guess_dynamic_shapes(auto = " dim" )
168+ print (ds)
169+
170+ ::
171+
172+ >>> (({0: 'dim_0I0', 1: 'dim_0I1'}, {1: 'dim_1I1'}), {})
173+
174+ use_dyn_for_str
175+ +++++++++++++++
176+
177+
178+
179+ Older versions
180+ ++++++++++++++
181+
182+ * `0.5.0 <../v0.5.0/index.html >`_
183+ * `0.4.4 <../v0.4.4/index.html >`_
184+ * `0.4.3 <../v0.4.3/index.html >`_
185+ * `0.4.2 <../v0.4.2/index.html >`_
186+ * `0.4.1 <../v0.4.1/index.html >`_
187+ * `0.4.0 <../v0.4.0/index.html >`_
188+ * `0.3.0 <../v0.3.0/index.html >`_
189+ * `0.2.2 <../v0.2.2/index.html >`_
190+ * `0.2.1 <../v0.2.1/index.html >`_
191+ * `0.2.0 <../v0.2.0/index.html >`_
192+ * `0.1.0 <../v0.1.0/index.html >`_
125193
126194The documentation was updated on:
127195
@@ -173,18 +241,3 @@ Size of the package:
173241 df = pandas.DataFrame(statistics_on_folder(os.path.dirname(__file__), aggregation=1))
174242 gr = df[["dir", "ext", "lines", "chars"]].groupby(["ext", "dir"]).sum()
175243 print(gr)
176-
177- Older versions
178- ++++++++++++++
179-
180- * `0.5.0 <../v0.5.0/index.html >`_
181- * `0.4.4 <../v0.4.4/index.html >`_
182- * `0.4.3 <../v0.4.3/index.html >`_
183- * `0.4.2 <../v0.4.2/index.html >`_
184- * `0.4.1 <../v0.4.1/index.html >`_
185- * `0.4.0 <../v0.4.0/index.html >`_
186- * `0.3.0 <../v0.3.0/index.html >`_
187- * `0.2.2 <../v0.2.2/index.html >`_
188- * `0.2.1 <../v0.2.1/index.html >`_
189- * `0.2.0 <../v0.2.0/index.html >`_
190- * `0.1.0 <../v0.1.0/index.html >`_
0 commit comments