Skip to content

Commit e16edae

Browse files
committed
delay import
1 parent f1ab122 commit e16edae

File tree

6 files changed

+26
-16
lines changed

6 files changed

+26
-16
lines changed

CHANGELOGS.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
Change Logs
22
===========
33

4+
0.7.4
5+
+++++
6+
7+
* :pr:`174`: changes for the next version of onnx
8+
49
0.7.3
510
+++++
611

712
* :pr:`173`: fixes function to_any for BaseModelOutput
813

9-
1014
0.7.2
1115
+++++
1216

_doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ The function replaces dynamic dimensions defined as strings by
237237
Older versions
238238
==============
239239

240-
* `0.7.3 <../v0.7.3/index.html>`_
240+
* `0.7.4 <../v0.7.4/index.html>`_
241241
* `0.6.3 <../v0.6.3/index.html>`_
242242
* `0.5.0 <../v0.5.0/index.html>`_
243243
* `0.4.4 <../v0.4.4/index.html>`_

_unittests/ut_export/test_shape_helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def test_all_dynamic_shape_from_inputs_dynamic_cache(self):
3737
"input_ids": {0: "d_0_0", 1: "d_0_1"},
3838
"attention_mask": {0: "d_1_0", 1: "d_1_1"},
3939
"position_ids": {0: "d_2_0", 1: "d_2_1"},
40-
"past_key_values": {
41-
"key_cache": [{0: "d_3_0", 1: "d_3_1", 2: "d_3_2", 3: "d_3_3"}],
42-
"value_cache": [{0: "d_4_0", 1: "d_4_1", 2: "d_4_2", 3: "d_4_3"}],
43-
},
40+
"past_key_values": [
41+
[{0: "d_3_0", 1: "d_3_1", 2: "d_3_2", 3: "d_3_3"}],
42+
[{0: "d_4_0", 1: "d_4_1", 2: "d_4_2", 3: "d_4_3"}],
43+
],
4444
},
4545
ds,
4646
)

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.7.3"
6+
__version__ = "0.7.4"
77
__author__ = "Xavier Dupré"

onnx_diagnostic/reference/ops/op_cast_like.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
from onnx.onnx_pb import TensorProto
22
from onnx.reference.op_run import OpRun
3-
from onnx.reference.ops.op_cast import (
4-
bfloat16,
5-
cast_to,
6-
float8e4m3fn,
7-
float8e4m3fnuz,
8-
float8e5m2,
9-
float8e5m2fnuz,
10-
)
3+
4+
try:
5+
from onnx.reference.ops.op_cast import (
6+
bfloat16,
7+
cast_to,
8+
float8e4m3fn,
9+
float8e4m3fnuz,
10+
float8e5m2,
11+
float8e5m2fnuz,
12+
)
13+
except ImportError:
14+
from onnx.reference.ops.op_cast import cast_to
1115
from ...helpers.onnx_helper import np_dtype_to_tensor_dtype
1216

1317

onnx_diagnostic/torch_models/validate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from ..tasks import random_input_kwargs
1919
from ..torch_export_patches import torch_export_patches
2020
from ..torch_export_patches.patch_inputs import use_dyn_not_str
21-
from ..reference import TorchOnnxEvaluator
2221
from .hghub import get_untrained_model_with_inputs
2322

2423

@@ -1113,6 +1112,9 @@ def _mk(key):
11131112
f"{providers}..., flavour={flavour!r}"
11141113
)
11151114

1115+
if runtime == "onnxruntime":
1116+
from ..reference import TorchOnnxEvaluator
1117+
11161118
cls_runtime = (
11171119
(
11181120
lambda model, providers: onnxruntime.InferenceSession(

0 commit comments

Comments
 (0)