diff --git a/python/tvm/relay/frontend/onnx.py b/python/tvm/relay/frontend/onnx.py index f4cf9572b93f..ce5084e1ece4 100644 --- a/python/tvm/relay/frontend/onnx.py +++ b/python/tvm/relay/frontend/onnx.py @@ -387,17 +387,6 @@ def _impl_v1(cls, inputs, attr, params): msg = 'Value {} in attribute "auto_pad" of operator Conv is invalid.' raise tvm.error.OpAttributeInvalid(msg.format(attr["auto_pad"])) attr.pop("auto_pad") - elif len(attr["kernel_shape"]) == 2: - sym_pad = True - if "pads" in attr: - padding = attr["pads"] - else: - padding = [0, 0, 0, 0] - for i in range(0, len(padding), 2): - sym_pad = sym_pad and padding[i] == padding[i + 1] - - if sym_pad: - attr["pads"] = padding[0::2] out = AttrCvt( op_name=dimension_picker("conv"), diff --git a/tests/python/frontend/onnx/test_forward.py b/tests/python/frontend/onnx/test_forward.py index da8629dfcd2b..799d8971b853 100644 --- a/tests/python/frontend/onnx/test_forward.py +++ b/tests/python/frontend/onnx/test_forward.py @@ -2504,6 +2504,16 @@ def repeat(N, D): repeat(1, D), repeat(1, D), ) + # Convolution with assymetric padding + verify_conv( + (1, 1) + repeat(5, D), + (1, 1) + repeat(3, D), + (1, 1) + repeat(4, D), + repeat(0, D) + repeat(1, D), + repeat(3, D), + repeat(1, D), + repeat(1, D), + ) # Convolution without padding verify_conv( (1, 1) + repeat(5, D),