3
3
from io import StringIO
4
4
5
5
import numpy as np
6
- import scipy
7
6
from onnx .defs import onnx_opset_version
8
7
from onnx .reference import ReferenceEvaluator
9
8
from onnxruntime import InferenceSession
21
20
22
21
23
22
class TestOrtTensor (ExtTestCase ):
24
- @unittest .skipIf (InferenceSession is None , reason = "onnxruntime is needed." )
25
23
def test_eager_numpy_type_ort (self ):
26
24
def impl (A ):
27
25
self .assertIsInstance (A , EagerOrtTensor )
@@ -47,7 +45,6 @@ def impl(A):
47
45
self .assertEqualArray (z , res .numpy ())
48
46
self .assertEqual (res .numpy ().dtype , np .float64 )
49
47
50
- @unittest .skipIf (InferenceSession is None , reason = "onnxruntime is needed." )
51
48
def test_eager_numpy_type_ort_op (self ):
52
49
def impl (A ):
53
50
self .assertIsInstance (A , EagerOrtTensor )
@@ -71,7 +68,6 @@ def impl(A):
71
68
self .assertEqualArray (z , res .numpy ())
72
69
self .assertEqual (res .numpy ().dtype , np .float64 )
73
70
74
- @unittest .skipIf (InferenceSession is None , reason = "onnxruntime is needed." )
75
71
def test_eager_ort (self ):
76
72
def impl (A ):
77
73
print ("A" )
@@ -145,8 +141,6 @@ def impl(A):
145
141
self .assertEqual (tuple (res .shape ()), z .shape )
146
142
self .assertStartsWith ("A\n B\n C\n " , text )
147
143
148
- @unittest .skipIf (InferenceSession is None , reason = "onnxruntime is not available" )
149
- @unittest .skipIf (scipy is None , reason = "scipy is not installed." )
150
144
def test_cdist_com_microsoft (self ):
151
145
from scipy .spatial .distance import cdist as scipy_cdist
152
146
0 commit comments