@@ -33,8 +33,8 @@ def test_same_padding_corr(self):
33
33
tf .reshape (kernel , (1 , - 1 , 1 , 1 )),
34
34
padding = "VALID" , data_format = "NHWC" )
35
35
outputs = np .squeeze (outputs .numpy ())
36
- pos_inp = np .squeeze (np .nonzero (inputs ))
37
- pos_out = np .squeeze (np .nonzero (outputs ))
36
+ pos_inp = np .squeeze (np .nonzero (inputs > .5 ))
37
+ pos_out = np .squeeze (np .nonzero (outputs > .5 ))
38
38
padding = padding_ops .same_padding_for_kernel (kshape , True )
39
39
self .assertEqual (padding [0 ][0 ], pos_inp - pos_out )
40
40
@@ -52,8 +52,8 @@ def test_same_padding_conv(self):
52
52
strides = (1 , 1 , 1 , 1 ), padding = "VALID" , data_format = "NHWC" )
53
53
outputs = outputs [:, :, (kshape [0 ] - 1 ):- (kshape [0 ] - 1 ), :]
54
54
outputs = np .squeeze (outputs .numpy ())
55
- pos_inp = np .squeeze (np .nonzero (inputs ))
56
- pos_out = np .squeeze (np .nonzero (outputs ))
55
+ pos_inp = np .squeeze (np .nonzero (inputs > .5 ))
56
+ pos_out = np .squeeze (np .nonzero (outputs > .5 ))
57
57
padding = padding_ops .same_padding_for_kernel (kshape , False )
58
58
self .assertEqual (padding [0 ][0 ], pos_inp - pos_out )
59
59
0 commit comments