Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions test/test_onnx.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# onnxruntime requires python 3.5 or above
try:
# This import should be before that of torch
# see https://github.com/onnx/onnx/issues/2394#issuecomment-581638840
import onnxruntime
except ImportError:
onnxruntime = None

from common_utils import set_rng_seed, assert_equal
import io
import pytest
import torch
from torchvision import ops
from torchvision import models
Expand All @@ -20,11 +13,13 @@
from collections import OrderedDict
from typing import List, Tuple

import pytest
from torchvision.ops._register_onnx_ops import _onnx_opset_version

# In environments without onnxruntime we prefer to
# invoke all tests in the repo and have this one skipped rather than fail.
onnxruntime = pytest.importorskip("onnxruntime")


@pytest.mark.skipif(onnxruntime is None, reason='ONNX Runtime unavailable')
class TestONNXExporter:
@classmethod
def setup_class(cls):
Expand Down