File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2299,21 +2299,21 @@ def rewrite_conv2d_with_pad(g, ops):
2299
2299
paddings = pad .inputs [1 ]
2300
2300
2301
2301
if not paddings .is_const ():
2302
- return ops
2302
+ continue
2303
2303
mode = pad .get_attr ("mode" )
2304
2304
if mode :
2305
2305
mode = mode .s .decode ("utf-8" ).lower ()
2306
2306
if mode not in [None , "constant" ] or len (pad .input ) >= 3 :
2307
- return ops
2307
+ continue
2308
2308
# Conv2D already has a pad
2309
2309
if conv .get_attr ("padding" ) == "SAME" :
2310
- return ops
2310
+ continue
2311
2311
2312
2312
log .debug ("merge pad [%s] into conv [%s]" , pad .name , conv .name )
2313
2313
paddings_val = np .array (paddings .get_tensor_value ())
2314
2314
# can't pad on batch or channel dimensions
2315
2315
if np .any (paddings_val [0 ]) or np .any (paddings_val [3 ]):
2316
- return ops
2316
+ continue
2317
2317
paddings_val = paddings_val [1 :3 ]
2318
2318
paddings_val = paddings_val .transpose ().flatten ()
2319
2319
g .replace_input (conv , conv .input [0 ], pad .input [0 ])
You can’t perform that action at this time.
0 commit comments