@@ -1302,11 +1302,11 @@ def test_less_or_equal(self):
1302
1302
node_def = helper .make_node ('LessOrEqual' , ['X' , 'Y' ], ['Z' ])
1303
1303
shape = [2 , 3 , 4 , 5 ]
1304
1304
x = self ._get_rnd_int (
1305
- np .iinfo (np .uint64 ).min ,
1306
- np .iinfo (np .uint64 ).max , shape , np .uint64 )
1305
+ np .iinfo (np .int64 ).min ,
1306
+ np .iinfo (np .int64 ).max , shape , np .int64 )
1307
1307
y = self ._get_rnd_int (
1308
- np .iinfo (np .uint64 ).min ,
1309
- np .iinfo (np .uint64 ).max , shape , np .uint64 )
1308
+ np .iinfo (np .int64 ).min ,
1309
+ np .iinfo (np .int64 ).max , shape , np .int64 )
1310
1310
output = run_node (node_def , [x , y ])
1311
1311
np .testing .assert_equal (output ['Z' ], np .less_equal (x , y ))
1312
1312
# test with broadcast
@@ -1319,6 +1319,22 @@ def test_less_or_equal(self):
1319
1319
np .finfo (np .float16 ).max , shape2 ).astype (np .float16 )
1320
1320
output = run_node (node_def , [x , y ])
1321
1321
np .testing .assert_equal (output ['Z' ], np .less_equal (x , y ))
1322
+ # test data types that are not natively supported by Tensorflow
1323
+ x = self ._get_rnd_int (
1324
+ np .iinfo (np .uint32 ).min ,
1325
+ np .iinfo (np .uint32 ).max , shape , np .uint32 )
1326
+ y = self ._get_rnd_int (
1327
+ np .iinfo (np .uint32 ).min ,
1328
+ np .iinfo (np .uint32 ).max , shape , np .uint32 )
1329
+ output = run_node (node_def , [x , y ])
1330
+ np .testing .assert_equal (output ['Z' ], np .less_equal (x , y ))
1331
+ x = self ._get_rnd_int (
1332
+ np .iinfo (np .uint64 ).min ,
1333
+ np .iinfo (np .uint64 ).max , shape , np .uint64 )
1334
+ y = self ._get_rnd_int (
1335
+ np .iinfo (np .uint64 ).min ,
1336
+ np .iinfo (np .uint64 ).max , shape , np .uint64 )
1337
+ self .assertRaises (RuntimeError , run_node , node_def , [x , y ])
1322
1338
1323
1339
def test_lp_normalization (self ):
1324
1340
for ordr in range (1 , 3 ):
@@ -1627,12 +1643,12 @@ def test_matmul(self):
1627
1643
a = self ._get_rnd_float32 (shape = [5 , 6 ])
1628
1644
b = self ._get_rnd_float32 (shape = [6 , 5 ])
1629
1645
output = run_node (node_def , [a , b ])
1630
- np .testing .assert_almost_equal (output ["Y" ], np .matmul (a , b ))
1646
+ np .testing .assert_allclose (output ["Y" ], np .matmul (a , b ), rtol = 1e-6 , atol = 1e-6 )
1631
1647
# test data types that are not natively supported by Tensorflow
1632
1648
a = self ._get_rnd_int (0 , 1000 , [10 , 10 ], np .uint32 )
1633
1649
b = self ._get_rnd_int (0 , 1000 , [10 , 10 ], np .uint32 )
1634
1650
output = run_node (node_def , [a , b ])
1635
- np .testing .assert_almost_equal (output ["Y" ], np .matmul (a , b ))
1651
+ np .testing .assert_allclose (output ["Y" ], np .matmul (a , b ), rtol = 1e-6 , atol = 1e-6 )
1636
1652
# sys_config.auto_cast=False and a or b dtype=uint64 should throw exception
1637
1653
self .assertRaises (
1638
1654
RuntimeError , run_node , node_def ,
0 commit comments