diff --git a/onnxoptimizer/passes/fuse_pad_into_conv.h b/onnxoptimizer/passes/fuse_pad_into_conv.h index a348a0206..782a1632d 100644 --- a/onnxoptimizer/passes/fuse_pad_into_conv.h +++ b/onnxoptimizer/passes/fuse_pad_into_conv.h @@ -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();