Skip to content

Commit

Permalink
skip if torch==1.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
q.yao committed Apr 29, 2021
1 parent ebc969c commit 6b3cf88
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ line_length = 79
multi_line_output = 0
known_standard_library = pkg_resources,setuptools
known_first_party = mmedit
known_third_party =PIL,cv2,lmdb,mmcv,numpy,onnx,onnxruntime,pymatting,pytest,scipy,titlecase,torch,torchvision
known_third_party =PIL,cv2,lmdb,mmcv,numpy,onnx,onnxruntime,packaging,pymatting,pytest,scipy,titlecase,torch,torchvision
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY
11 changes: 10 additions & 1 deletion tests/test_onnx_wraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
import numpy as np
import pytest
import torch
from packaging import version

from mmedit.models import build_model


@pytest.mark.skipif(torch.__version__ == 'parrots', reason='skip parrots.')
@pytest.mark.skipif(
version.parse(torch.__version__) < version.parse('1.4.0'),
reason='skip if torch=1.3.x')
def test_restorer_wraper():
try:
import onnxruntime as ort
Expand Down Expand Up @@ -55,7 +60,7 @@ def test_restorer_wraper():
opset_version=11)

wrap_model = ONNXRuntimeEditing(onnx_path, cfg, 0)
os.remove(onnx_path)
# os.remove(onnx_path)
assert isinstance(wrap_model.wraper, ONNXRuntimeRestorer)

if ort.get_device() == 'GPU':
Expand All @@ -71,6 +76,10 @@ def test_restorer_wraper():
assert output.shape == targets.shape


@pytest.mark.skipif(torch.__version__ == 'parrots', reason='skip parrots.')
@pytest.mark.skipif(
version.parse(torch.__version__) < version.parse('1.4.0'),
reason='skip if torch=1.3.x')
def test_mattor_wraper():
try:
import onnxruntime as ort
Expand Down

0 comments on commit 6b3cf88

Please sign in to comment.