@@ -1059,20 +1059,16 @@ def test_cast(self):
1059
1059
_ = tf .identity (x_ , name = _TFOUTPUT )
1060
1060
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1061
1061
1062
- @check_opset_min_version (9 )
1063
- def test_sign_int (self ):
1064
- x_val = np .array ([1 , 2 , 0 , - 1 , 0 , - 2 ], dtype = np .int ).reshape ((2 , 3 ))
1065
- x = tf .placeholder (tf .int32 , [2 , 3 ], name = _TFINPUT )
1066
- x_ = tf .sign (x )
1067
- _ = tf .identity (x_ , name = _TFOUTPUT )
1068
- self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1069
-
1070
1062
def test_sign (self ):
1071
- x_val = np .array ([1.0 , 2.0 , 0.0 , - 1.0 , 0.0 , - 2.0 ], dtype = np .float32 ).reshape ((2 , 3 ))
1072
- x = tf .placeholder (tf .float32 , [2 , 3 ], name = _TFINPUT )
1073
- x_ = tf .sign (x )
1074
- _ = tf .identity (x_ , name = _TFOUTPUT )
1075
- self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1063
+ x_val1 = np .array ([1 , 2 , 0 , - 1 , 0 , - 2 ], dtype = np .int32 ).reshape ((2 , 3 ))
1064
+ x_val2 = np .array ([1 , 2 , 0 , - 1 , 0 , - 2 ], dtype = np .int64 ).reshape ((2 , 3 ))
1065
+ x_val3 = np .array ([1.0 , 2.0 , 0.0 , - 1.0 , 0.0 , - 2.0 ], dtype = np .float32 ).reshape ((2 , 3 ))
1066
+ for x_val in [x_val1 , x_val2 , x_val3 ]:
1067
+ x = tf .placeholder (x_val .dtype , x_val .shape , name = _TFINPUT )
1068
+ x_ = tf .sign (x )
1069
+ _ = tf .identity (x_ , name = _TFOUTPUT )
1070
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1071
+ tf .reset_default_graph ()
1076
1072
1077
1073
def test_onehot0 (self ):
1078
1074
x_val = np .array ([0 , 1 , 2 ], dtype = np .int32 )
0 commit comments