Skip to content

Commit a4224d7

Browse files
committed
doc
1 parent 225a3ac commit a4224d7

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

onnx_diagnostic/helpers/onnx_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def onnx_lighten(
4646
"""
4747
Creates a model without big initializers but stores statistics
4848
into dictionaries. The function can be reversed with
49-
:func:`onnx_diagnostic.onnx_helper.onnx_unlighten`.
49+
:func:`onnx_diagnostic.helpers.onnx_helper.onnx_unlighten`.
5050
The model is modified inplace.
5151
5252
:param onx: model
@@ -103,7 +103,7 @@ def onnx_unlighten(
103103
) -> ModelProto:
104104
"""
105105
Function fixing the model produced by function
106-
:func:`onnx_diagnostic.onnx_helper.onnx_lighten`.
106+
:func:`onnx_diagnostic.helpers.onnx_helper.onnx_lighten`.
107107
The model is modified inplace.
108108
109109
:param onx: model

onnx_diagnostic/torch_onnx/sbs.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,9 @@ def run_aligned(
178178
import torch
179179
from onnx_diagnostic.reference import (
180180
# This can be replace by any runtime taking NodeProto as an input.
181-
ExtendedReferenceEvaluator as ReferenceEvaluator
181+
ExtendedReferenceEvaluator as ReferenceEvaluator,
182182
)
183-
from onnx_diagnostic.torch_interpreter import to_onnx
184-
from onnx_diagnostic.torch_interpreter.investigate_helper import run_aligned
183+
from onnx_diagnostic.torch_onnx.sbs import run_aligned
185184
186185
187186
class Model(torch.nn.Module):
@@ -205,17 +204,17 @@ def post_process(obs):
205204
ep = torch.export.export(
206205
Model(), (x,), dynamic_shapes=({0: torch.export.Dim("batch")},)
207206
)
208-
onx = to_onnx(ep)
207+
onx = torch.onnx.export(
208+
Model(), (x,), dynamic_shapes=({0: torch.export.Dim("batch")},), dynamo=True
209+
).model_proto
209210
results = list(
210211
map(
211212
post_process,
212213
run_aligned(
213214
ep,
214215
onx,
215216
(x,),
216-
check_conversion_cls=dict(
217-
cls=ReferenceEvaluator, atol=1e-5, rtol=1e-5
218-
),
217+
check_conversion_cls=dict(cls=ReferenceEvaluator, atol=1e-5, rtol=1e-5),
219218
verbose=1,
220219
),
221220
),

0 commit comments

Comments
 (0)