Skip to content

Commit

Permalink
[opt:fuse_pad_into_conv] remove auto_pad, when use pads
Browse files Browse the repository at this point in the history
Signed-off-by: 462630221 <[email protected]>
  • Loading branch information
xiaobochen123 committed Feb 20, 2021
1 parent c40d3c0 commit 8f5a6e9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions onnxoptimizer/passes/fuse_pad_into_conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ struct FusePadIntoConv final : public PredicateBasedPass {
conv_pads[conv_pads_size / 2 + j] += pads[pads_size / 2 + i];
}

// Clean the auto_pad
if (conv->hasAttribute(Symbol("auto_pad"))){
conv->removeAttribute(Symbol("auto_pad"));
}

conv->is_(kpads, std::move(conv_pads));
conv->replaceInput(0, pad->inputs()[0]);
pad->destroy();
Expand Down

0 comments on commit 8f5a6e9

Please sign in to comment.