@@ -111,7 +111,7 @@ def _run_test_case(self, output_names_with_port, feed_dict, **kwargs):
111
111
kwargs ["convert_var_to_const" ] = False
112
112
kwargs ["constant_fold" ] = False
113
113
return self .run_test_case (feed_dict , [], output_names_with_port , ** kwargs )
114
- '''
114
+
115
115
def _test_expand_dims_known_rank (self , idx ):
116
116
tf .reset_default_graph ()
117
117
x_val = make_xval ([3 , 4 ])
@@ -2902,23 +2902,68 @@ def test_unique(self):
2902
2902
# FIXME: indices in onnx are not the same as in tensorflow so don't check for now
2903
2903
# self._run_test_case([_OUTPUT, _OUTPUT1], {_INPUT: x_val})
2904
2904
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val })
2905
- '''
2906
2905
2906
+ @check_opset_min_version (10 , "Conv2DBackpropInput" )
2907
2907
def test_Conv2DBackpropInput_const (self ):
2908
2908
input_sizes_val = np .array ([1 , 10 , 10 , 3 ], dtype = np .int32 )
2909
2909
filter_val = np .random .randint (low = 0 , high = 256 , size = [3 , 3 , 3 , 5 ]).astype (np .float32 )
2910
2910
out_backprop_val = np .random .randint (low = 0 , high = 256 , size = [1 , 10 , 10 , 5 ]).astype (np .float32 )
2911
- _ = tf .nn .conv2d_backprop_input (input_sizes = input_sizes_val , filter = filter_val , out_backprop = out_backprop_val , strides = [1 ,1 ,1 ,1 ], padding = 'SAME' , name = _TFOUTPUT )
2911
+ _ = tf .nn .conv2d_backprop_input (input_sizes = input_sizes_val , filter = filter_val , out_backprop = out_backprop_val ,
2912
+ strides = [1 , 1 , 1 , 1 ], padding = 'SAME' , name = _TFOUTPUT )
2913
+ self ._run_test_case ([_OUTPUT ], {})
2914
+
2915
+ @check_opset_min_version (10 , "Conv2DBackpropInput" )
2916
+ def test_Conv2DBackpropInput_const_strided (self ):
2917
+ input_sizes_val = np .array ([1 , 10 , 10 , 3 ], dtype = np .int32 )
2918
+ filter_val = np .random .randint (low = 0 , high = 256 , size = [3 , 3 , 3 , 5 ]).astype (np .float32 )
2919
+ out_backprop_val = np .random .randint (low = 0 , high = 256 , size = [1 , 5 , 5 , 5 ]).astype (np .float32 )
2920
+ _ = tf .nn .conv2d_backprop_input (input_sizes = input_sizes_val , filter = filter_val , out_backprop = out_backprop_val ,
2921
+ strides = [1 , 2 , 2 , 1 ], padding = 'SAME' , name = _TFOUTPUT )
2922
+ self ._run_test_case ([_OUTPUT ], {})
2923
+
2924
+ @check_opset_min_version (10 , "Conv2DBackpropInput" )
2925
+ def test_Conv2DBackpropInput_const_valid (self ):
2926
+ input_sizes_val = np .array ([1 , 12 , 12 , 3 ], dtype = np .int32 )
2927
+ filter_val = np .random .randint (low = 0 , high = 256 , size = [3 , 3 , 3 , 5 ]).astype (np .float32 )
2928
+ out_backprop_val = np .random .randint (low = 0 , high = 256 , size = [1 , 10 , 10 , 5 ]).astype (np .float32 )
2929
+ _ = tf .nn .conv2d_backprop_input (input_sizes = input_sizes_val , filter = filter_val , out_backprop = out_backprop_val ,
2930
+ strides = [1 , 1 , 1 , 1 ], padding = 'VALID' , name = _TFOUTPUT )
2912
2931
self ._run_test_case ([_OUTPUT ], {})
2913
2932
2933
+ @check_opset_min_version (10 , "Conv2DBackpropInput" )
2914
2934
def test_Conv2DBackpropInput (self ):
2915
2935
input_sizes_val = np .array ([1 , 10 , 10 , 3 ], dtype = np .int32 )
2916
2936
input_sizes = tf .placeholder (tf .int32 , input_sizes_val .shape , name = _TFINPUT )
2917
2937
filter_val = np .random .randint (low = 0 , high = 256 , size = [3 , 3 , 3 , 5 ]).astype (np .float32 )
2918
2938
filter = tf .placeholder (tf .float32 , filter_val .shape , name = _TFINPUT1 )
2919
2939
out_backprop_val = np .random .randint (low = 0 , high = 256 , size = [1 , 10 , 10 , 5 ]).astype (np .float32 )
2920
2940
out_backprop = tf .placeholder (tf .float32 , out_backprop_val .shape , name = _TFINPUT2 )
2921
- _ = tf .nn .conv2d_backprop_input (input_sizes , filter , out_backprop , strides = [1 ,1 ,1 ,1 ], padding = 'SAME' , name = _TFOUTPUT )
2941
+ _ = tf .nn .conv2d_backprop_input (input_sizes , filter , out_backprop , strides = [1 , 1 , 1 , 1 ], padding = 'SAME' ,
2942
+ name = _TFOUTPUT )
2943
+ self ._run_test_case ([_OUTPUT ], {_INPUT : input_sizes_val , _INPUT1 : filter_val , _INPUT2 : out_backprop_val })
2944
+
2945
+ @check_opset_min_version (10 , "Conv2DBackpropInput" )
2946
+ def test_Conv2DBackpropInput_strided (self ):
2947
+ input_sizes_val = np .array ([1 , 10 , 10 , 3 ], dtype = np .int32 )
2948
+ input_sizes = tf .placeholder (tf .int32 , input_sizes_val .shape , name = _TFINPUT )
2949
+ filter_val = np .random .randint (low = 0 , high = 256 , size = [3 , 3 , 3 , 5 ]).astype (np .float32 )
2950
+ filter = tf .placeholder (tf .float32 , filter_val .shape , name = _TFINPUT1 )
2951
+ out_backprop_val = np .random .randint (low = 0 , high = 256 , size = [1 , 5 , 5 , 5 ]).astype (np .float32 )
2952
+ out_backprop = tf .placeholder (tf .float32 , out_backprop_val .shape , name = _TFINPUT2 )
2953
+ _ = tf .nn .conv2d_backprop_input (input_sizes , filter , out_backprop , strides = [1 , 2 , 2 , 1 ], padding = 'SAME' ,
2954
+ name = _TFOUTPUT )
2955
+ self ._run_test_case ([_OUTPUT ], {_INPUT : input_sizes_val , _INPUT1 : filter_val , _INPUT2 : out_backprop_val })
2956
+
2957
+ @check_opset_min_version (10 , "Conv2DBackpropInput" )
2958
+ def test_Conv2DBackpropInput_valid (self ):
2959
+ input_sizes_val = np .array ([1 , 12 , 12 , 3 ], dtype = np .int32 )
2960
+ input_sizes = tf .placeholder (tf .int32 , input_sizes_val .shape , name = _TFINPUT )
2961
+ filter_val = np .random .randint (low = 0 , high = 256 , size = [3 , 3 , 3 , 5 ]).astype (np .float32 )
2962
+ filter = tf .placeholder (tf .float32 , filter_val .shape , name = _TFINPUT1 )
2963
+ out_backprop_val = np .random .randint (low = 0 , high = 256 , size = [1 , 10 , 10 , 5 ]).astype (np .float32 )
2964
+ out_backprop = tf .placeholder (tf .float32 , out_backprop_val .shape , name = _TFINPUT2 )
2965
+ _ = tf .nn .conv2d_backprop_input (input_sizes , filter , out_backprop , strides = [1 , 1 , 1 , 1 ], padding = 'VALID' ,
2966
+ name = _TFOUTPUT )
2922
2967
self ._run_test_case ([_OUTPUT ], {_INPUT : input_sizes_val , _INPUT1 : filter_val , _INPUT2 : out_backprop_val })
2923
2968
2924
2969
0 commit comments