Skip to content

Commit 0493e13

Browse files
committed
import
1 parent 87bdfd9 commit 0493e13

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/tests_pytorch/models/test_onnx.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@
3232
from tests_pytorch.helpers.runif import RunIf
3333
from tests_pytorch.utilities.test_model_summary import UnorderedModel
3434

35-
if _TORCH_GREATER_EQUAL_2_6:
36-
from torch.onnx import ONNXProgram
37-
else:
38-
from torch.onnx._internal.exporter import ONNXProgram
39-
4035

4136
@RunIf(onnx=True)
4237
def test_model_saves_with_input_sample(tmp_path):
@@ -208,6 +203,11 @@ def test_model_onnx_export_missing_onnxscript():
208203

209204
@RunIf(onnx=True, min_torch="2.5.0", dynamo=True, onnxscript=True)
210205
def test_model_return_type():
206+
if _TORCH_GREATER_EQUAL_2_6:
207+
from torch.onnx import ONNXProgram
208+
else:
209+
from torch.onnx._internal.exporter import ONNXProgram
210+
211211
model = BoringModel()
212212
model.example_input_array = torch.randn((1, 32))
213213
model.eval()

0 commit comments

Comments
 (0)