@@ -69,9 +69,6 @@ def get_conv_getdata(kind=1):
69
69
data = [
70
70
('SAME' , [32 , 35 , 35 , 288 ], [1 , 3 , 3 , 1 ], [1 , 2 , 2 , 1 ]),
71
71
('SAME' , [32 , 35 , 35 , 288 ], [1 , 2 , 2 , 1 ], [1 , 2 , 2 , 1 ]),
72
- ('SAME' , [32 , 35 , 35 , 288 ], [1 , 2 , 2 , 1 ], [1 , 1 , 1 , 1 ]),
73
- ('SAME' , [32 , 35 , 35 , 288 ], [1 , 5 , 5 , 1 ], [1 , 1 , 1 , 1 ]),
74
- ('SAME' , [32 , 35 , 35 , 288 ], [1 , 1 , 1 , 1 ], [1 , 2 , 2 , 1 ]),
75
72
('SAME' , [32 , 35 , 35 , 288 ], [1 , 1 , 1 , 1 ], [1 , 1 , 1 , 1 ]),
76
73
('SAME' , [32 , 35 , 35 , 288 ], [1 , 5 , 2 , 1 ], [1 , 2 , 2 , 1 ]),
77
74
('SAME' , [32 , 35 , 35 , 288 ], [1 , 2 , 5 , 1 ], [1 , 2 , 2 , 1 ]),
@@ -83,7 +80,6 @@ def get_conv_getdata(kind=1):
83
80
('SAME' , [1 , 28 , 28 , 3 ], [1 , 5 , 5 , 1 ], [1 , 2 , 2 , 1 ]),
84
81
('SAME' , [1 , 28 , 28 , 3 ], [1 , 5 , 5 , 1 ], [1 , 1 , 1 , 1 ]),
85
82
('SAME' , [1 , 28 , 28 , 3 ], [1 , 5 , 2 , 1 ], [1 , 2 , 2 , 1 ]),
86
- ('SAME' , [1 , 28 , 28 , 3 ], [1 , 2 , 5 , 1 ], [1 , 1 , 1 , 1 ]),
87
83
('SAME' , [32 , 8 , 8 , 2048 ], [1 , 3 , 3 , 1 ], [1 , 2 , 2 , 1 ]),
88
84
('SAME' , [32 , 8 , 8 , 2048 ], [1 , 3 , 3 , 1 ], [1 , 1 , 1 , 1 ]),
89
85
('VALID' , [32 , 35 , 35 , 288 ], [1 , 3 , 3 , 1 ], [1 , 1 , 1 , 1 ]),
@@ -975,7 +971,6 @@ def test_strided_slice1(self):
975
971
actual , expected = self ._run (output , {x : x_val }, {_INPUT : x_val })
976
972
self .assertAllClose (expected , actual )
977
973
978
- @unittest .skipIf (BACKEND in ["caffe2" , "onnxmsrt" ], "multiple dims not supported" )
979
974
def test_strided_slice2 (self ):
980
975
x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (3 , 2 , 3 )
981
976
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
@@ -984,7 +979,6 @@ def test_strided_slice2(self):
984
979
actual , expected = self ._run (output , {x : x_val }, {_INPUT : x_val })
985
980
self .assertAllClose (expected , actual )
986
981
987
- @unittest .skip
988
982
def test_strided_slice3 (self ):
989
983
x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (3 , 2 , 3 )
990
984
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
@@ -993,7 +987,6 @@ def test_strided_slice3(self):
993
987
actual , expected = self ._run (output , {x : x_val }, {_INPUT : x_val })
994
988
self .assertAllClose (expected , actual )
995
989
996
- @unittest .skip
997
990
def test_strided_slice4 (self ):
998
991
x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (3 , 2 , 3 )
999
992
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
@@ -1002,7 +995,7 @@ def test_strided_slice4(self):
1002
995
actual , expected = self ._run (output , {x : x_val }, {_INPUT : x_val })
1003
996
self .assertAllClose (expected , actual )
1004
997
1005
- @unittest .skip
998
+ @unittest .skipIf ( BACKEND in [ "caffe2" , "onnxmsrt" ], "multiple dims not supported" )
1006
999
def test_strided_slice5 (self ):
1007
1000
x_val = np .arange (3 * 2 * 3 ).astype ("float32" ).reshape (3 , 2 , 3 )
1008
1001
x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
@@ -1011,6 +1004,17 @@ def test_strided_slice5(self):
1011
1004
actual , expected = self ._run (output , {x : x_val }, {_INPUT : x_val })
1012
1005
self .assertAllClose (expected , actual )
1013
1006
1007
+ @unittest .skipIf (BACKEND in ["caffe2" , "onnxmsrt" ], "multiple dims not supported" )
1008
+ def test_strided_slice6 (self ):
1009
+ # example from here:
1010
+ # https://www.tensorflow.org/versions/r1.0/api_docs/cc/class/tensorflow/ops/strided-slice
1011
+ x_val = np .arange (5 * 6 ).astype ("float32" ).reshape (5 , 6 )
1012
+ x = tf .placeholder (tf .float32 , x_val .shape , name = _TFINPUT )
1013
+ x_ = x [2 , :]
1014
+ output = tf .identity (x_ , name = _TFOUTPUT )
1015
+ actual , expected = self ._run (output , {x : x_val }, {_INPUT : x_val })
1016
+ self .assertAllClose (expected , actual )
1017
+
1014
1018
@unittest .skipIf (BACKEND in ["caffe2" , "onnxmsrt" ], "fails with schema error" )
1015
1019
def test_batchnorm (self ):
1016
1020
x_shape = [1 , 28 , 28 , 2 ]
@@ -1075,7 +1079,7 @@ def test_fill(self):
1075
1079
1076
1080
if __name__ == "__main__" :
1077
1081
parser = argparse .ArgumentParser ()
1078
- parser .add_argument ('--backend' , default = 'caffe2' ,
1082
+ parser .add_argument ('--backend' , default = BACKEND ,
1079
1083
choices = ["caffe2" , "onnxmsrt" , "onnxmsrtnext" , "onnx-tensorflow" ],
1080
1084
help = "backend to test against" )
1081
1085
parser .add_argument ('--opset' , default = OPSET ,
0 commit comments