Skip to content

Commit

Permalink
skip test_simplify for torch<1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RunningLeon committed Dec 31, 2020
1 parent 4551982 commit 5b1aca8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ line_length = 79
multi_line_output = 0
known_standard_library = pkg_resources,setuptools
known_first_party = mmcv
known_third_party = addict,cv2,m2r,numpy,onnx,onnxoptimizer,onnxruntime,pytest,recommonmark,resnet_cifar,torch,torchvision,yaml,yapf
known_third_party = addict,cv2,m2r,numpy,onnx,onnxoptimizer,onnxruntime,packaging,pytest,recommonmark,resnet_cifar,torch,torchvision,yaml,yapf
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY
6 changes: 5 additions & 1 deletion tests/test_ops/test_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pytest
import torch
import torch.nn as nn
from packaging import version

onnx_file = 'tmp.onnx'

Expand Down Expand Up @@ -65,7 +66,6 @@ def test_nms():
reason='CUDA is unavailable for test_softnms')
def test_softnms():
from mmcv.ops import get_onnxruntime_op_path, soft_nms
from packaging import version

# only support pytorch >= 1.7.0
if version.parse(torch.__version__) < version.parse('1.7.0'):
Expand Down Expand Up @@ -275,6 +275,10 @@ def warpped_function(torch_input, torch_rois):
def test_simplify():
from mmcv.onnx import simplify

# only support PyTorch >= 1.5.0
if version.parse(torch.__version__) < version.parse('1.5.0'):
pytest.skip('mmcv.onnx.simplify only support with PyTorch >= 1.5.0')

def foo(x):
y = x.view((x.shape[0], x.shape[1], x.shape[3], x.shape[2]))
return y
Expand Down

0 comments on commit 5b1aca8

Please sign in to comment.