@@ -3190,12 +3190,13 @@ def func(X, K):
3190
3190
k_val = np .array (raw_k ).astype (np .int32 )
3191
3191
self ._run_test_case (func , [_OUTPUT , _OUTPUT1 ], {_INPUT : x_val , _INPUT1 : k_val })
3192
3192
3193
- @check_opset_min_version (12 )
3194
- def test_inverse (self ):
3193
+ @test_ms_domain ()
3194
+ def test_inverse (self , extra_opset ):
3195
+ # this depends on onnx Inverse which was removed from opset-12 but does exists in the ms-domain
3195
3196
x_val = np .random .random ([5 , 5 ]).astype (np .float32 )
3196
3197
def func (x ):
3197
3198
return tf .linalg .inv (x , name = _TFOUTPUT )
3198
- self ._run_test_case (func , [_OUTPUT ], {_INPUT : x_val })
3199
+ self ._run_test_case (func , [_OUTPUT ], {_INPUT : x_val }, process_args = { "extra_opset" : [ extra_opset ]} )
3199
3200
3200
3201
@check_opset_min_version (12 )
3201
3202
def test_squared_distance (self ):
@@ -3224,6 +3225,15 @@ def func(x, y):
3224
3225
tf .math .greater_equal (x , y , name = _TFOUTPUT1 )
3225
3226
self ._run_test_case (func , [_OUTPUT , _OUTPUT1 ], {_INPUT : x_val , _INPUT1 : y_val })
3226
3227
3228
+ @check_tf_min_version ("1.14" , "required for tf.math.is_finite" )
3229
+ @check_opset_min_version (10 )
3230
+ def test_is_finite (self ):
3231
+ x_val = np .array ([5.0 , 4.8 , 6.8 , np .inf , np .nan ], dtype = np .float32 )
3232
+ def func (x ):
3233
+ y = tf .math .is_finite (x )
3234
+ return tf .identity (y , name = _TFOUTPUT )
3235
+ self ._run_test_case (func , [_OUTPUT ], {_INPUT : x_val })
3236
+
3227
3237
3228
3238
if __name__ == '__main__' :
3229
3239
unittest_main ()
0 commit comments