@@ -724,7 +724,6 @@ def test_equal(self):
724
724
_ = tf .identity (mi , name = _TFOUTPUT )
725
725
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val1 , _INPUT1 : x_val2 })
726
726
727
-
728
727
def test_sequeeze_no_axis_specified (self ):
729
728
x_val = np .array ([1.0 , 2.0 , 3.0 , 4.0 ], dtype = np .float32 ).reshape ((2 , 2 , 1 ))
730
729
x = tf .placeholder (tf .float32 , [2 , 2 , 1 ], name = _TFINPUT )
@@ -982,14 +981,14 @@ def test_slice1(self):
982
981
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
983
982
984
983
def test_split (self ):
985
- x_val = np .linspace (1.0 , 5 * 30.0 , 5 * 30 ).astype (np .float32 ).reshape (5 , 30 )
984
+ x_val = np .linspace (1.0 , 5 * 30.0 , 5 * 30 ).astype (np .float32 ).reshape (( 5 , 30 ) )
986
985
x0 = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
987
986
x_ , _ , _ = tf .split (x0 , [4 , 15 , 11 ], 1 )
988
987
_ = tf .identity (x_ , name = _TFOUTPUT )
989
988
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
990
989
991
990
def test_split_with_more_outputs (self ):
992
- x_val = np .linspace (1.0 , 5 * 30.0 , 5 * 30 ).astype (np .float32 ).reshape (5 , 30 )
991
+ x_val = np .linspace (1.0 , 5 * 30.0 , 5 * 30 ).astype (np .float32 ).reshape (( 5 , 30 ) )
993
992
x0 = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
994
993
_ , _ , _ = tf .split (x0 , [4 , 15 , 11 ], 1 , name = "split_test" )
995
994
self ._run_test_case (["split_test:0" , "split_test:1" , "split_test:2" ], {_INPUT : x_val })
@@ -1418,36 +1417,36 @@ def test_addn(self):
1418
1417
1419
1418
@skip_caffe2_backend ("multiple dims not supported" )
1420
1419
def test_strided_slice1 (self ):
1421
- x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (3 , 2 , 3 )
1420
+ x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (( 3 , 2 , 3 ) )
1422
1421
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1423
1422
x_ = tf .strided_slice (x , [1 , 0 , 0 ], [2 , 1 , 3 ], [1 , 1 , 1 ])
1424
1423
_ = tf .identity (x_ , name = _TFOUTPUT )
1425
1424
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1426
1425
1427
1426
def test_strided_slice2 (self ):
1428
- x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (3 , 2 , 3 )
1427
+ x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (( 3 , 2 , 3 ) )
1429
1428
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1430
1429
x_ = tf .strided_slice (x , [1 , 0 , 0 ], [2 , 2 , 3 ], [1 , 1 , 1 ])
1431
1430
_ = tf .identity (x_ , name = _TFOUTPUT )
1432
1431
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1433
1432
1434
1433
def test_strided_slice3 (self ):
1435
- x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (3 , 2 , 3 )
1434
+ x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (( 3 , 2 , 3 ) )
1436
1435
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1437
1436
x_ = x [1 :]
1438
1437
_ = tf .identity (x_ , name = _TFOUTPUT )
1439
1438
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1440
1439
1441
1440
def test_strided_slice4 (self ):
1442
- x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (3 , 2 , 3 )
1441
+ x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (( 3 , 2 , 3 ) )
1443
1442
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1444
1443
x_ = x [:2 ]
1445
1444
_ = tf .identity (x_ , name = _TFOUTPUT )
1446
1445
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1447
1446
1448
1447
@skip_caffe2_backend ("multiple dims not supported" )
1449
1448
def test_strided_slice5 (self ):
1450
- x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (3 , 2 , 3 )
1449
+ x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (( 3 , 2 , 3 ) )
1451
1450
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1452
1451
x_ = x [:2 , 0 :1 , 1 :]
1453
1452
_ = tf .identity (x_ , name = _TFOUTPUT )
@@ -1457,15 +1456,15 @@ def test_strided_slice5(self):
1457
1456
def test_strided_slice6 (self ):
1458
1457
# example from here:
1459
1458
# https://www.tensorflow.org/versions/r1.0/api_docs/cc/class/tensorflow/ops/strided-slice
1460
- x_val = np .arange (5 * 6 ).astype ("float32" ).reshape (5 , 6 )
1459
+ x_val = np .arange (5 * 6 ).astype ("float32" ).reshape (( 5 , 6 ) )
1461
1460
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1462
1461
x_ = x [2 , :]
1463
1462
_ = tf .identity (x_ , name = _TFOUTPUT )
1464
1463
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1465
1464
1466
1465
@skip_caffe2_backend ("multiple dims not supported" )
1467
1466
def test_strided_slice7 (self ):
1468
- x_val = np .arange (5 * 6 ).astype ("float32" ).reshape (5 , 6 )
1467
+ x_val = np .arange (5 * 6 ).astype ("float32" ).reshape (( 5 , 6 ) )
1469
1468
1470
1469
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1471
1470
x_ = tf .strided_slice (x , [0 , 1 ], [3 , 4 ], [1 , 1 ], begin_mask = 2 )
0 commit comments