@@ -1621,6 +1621,28 @@ def test_strided_slice7(self):
1621
1621
_ = tf .identity (x_ , name = _TFOUTPUT )
1622
1622
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1623
1623
1624
+ @skip_caffe2_backend ("multiple dims not supported" )
1625
+ def test_strided_slice8 (self ):
1626
+ x_val = np .arange (1 * 2 * 3 * 4 * 5 * 6 ).astype ("float32" ).reshape ((1 , 2 , 3 , 4 , 5 , 6 ))
1627
+ x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1628
+ x_ = x [0 :1 , ..., 1 , 2 :, :6 ]
1629
+ _ = tf .identity (x_ , name = _TFOUTPUT )
1630
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1631
+
1632
+ tf .reset_default_graph ()
1633
+ x_val = np .arange (1 * 2 * 3 * 4 * 5 * 6 ).astype ("float32" ).reshape ((1 , 2 , 3 , 4 , 5 , 6 ))
1634
+ x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1635
+ x_ = x [0 :1 , 1 , 2 :, :6 , ...]
1636
+ _ = tf .identity (x_ , name = _TFOUTPUT )
1637
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1638
+
1639
+ tf .reset_default_graph ()
1640
+ x_val = np .arange (1 * 2 * 3 * 4 * 5 * 6 ).astype ("float32" ).reshape ((1 , 2 , 3 , 4 , 5 , 6 ))
1641
+ x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1642
+ x_ = x [..., 0 :1 , 1 , 2 :, :6 ]
1643
+ _ = tf .identity (x_ , name = _TFOUTPUT )
1644
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
1645
+
1624
1646
@check_opset_min_version (10 , "Slice" )
1625
1647
@skip_caffe2_backend ("multiple dims not supported" )
1626
1648
def test_strided_slice_dynamic_1 (self ):
@@ -1702,6 +1724,35 @@ def test_strided_slice_dynamic_6(self):
1702
1724
_ = tf .identity (x_ , name = _TFOUTPUT )
1703
1725
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val , _INPUT1 : y_val })
1704
1726
1727
+ @check_opset_min_version (10 , "Slice" )
1728
+ @skip_caffe2_backend ("multiple dims not supported" )
1729
+ def test_strided_slice_dynamic_7 (self ):
1730
+ x_val = np .arange (1 * 2 * 3 * 4 * 5 * 6 ).astype ("float32" ).reshape ((1 , 2 , 3 , 4 , 5 , 6 ))
1731
+ y_val = np .array (1 , dtype = np .int32 )
1732
+ x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1733
+ y = tf .placeholder (tf .int32 , y_val .shape , name = _TFINPUT1 )
1734
+ x_ = x [0 :y , ..., y , y :, :y ]
1735
+ _ = tf .identity (x_ , name = _TFOUTPUT )
1736
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val , _INPUT1 : y_val })
1737
+
1738
+ tf .reset_default_graph ()
1739
+ x_val = np .arange (1 * 2 * 3 * 4 * 5 * 6 ).astype ("float32" ).reshape ((1 , 2 , 3 , 4 , 5 , 6 ))
1740
+ y_val = np .array (1 , dtype = np .int32 )
1741
+ x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1742
+ y = tf .placeholder (tf .int32 , y_val .shape , name = _TFINPUT1 )
1743
+ x_ = x [0 :y , y , y :, :y , ...]
1744
+ _ = tf .identity (x_ , name = _TFOUTPUT )
1745
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val , _INPUT1 : y_val })
1746
+
1747
+ tf .reset_default_graph ()
1748
+ x_val = np .arange (1 * 2 * 3 * 4 * 5 * 6 ).astype ("float32" ).reshape ((1 , 2 , 3 , 4 , 5 , 6 ))
1749
+ y_val = np .array (1 , dtype = np .int32 )
1750
+ x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1751
+ y = tf .placeholder (tf .int32 , y_val .shape , name = _TFINPUT1 )
1752
+ x_ = x [..., 0 :y , y , y :, :y ]
1753
+ _ = tf .identity (x_ , name = _TFOUTPUT )
1754
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val , _INPUT1 : y_val })
1755
+
1705
1756
@skip_caffe2_backend ("fails with schema error" )
1706
1757
@check_opset_min_version (7 , "batchnorm" )
1707
1758
def test_batchnorm (self ):
0 commit comments