This is an automated email from the ASF dual-hosted git repository. mbrookhart pushed a commit to branch ci-docker-staging in repository https://gitbox.apache.org/repos/asf/tvm.git
commit ed3c7fe9c439454a0337d85deeb7a9f07edd30c6 Author: Matthew <mbrookh...@octoml.ai> AuthorDate: Thu Jun 17 09:57:31 2021 -0600 Don't force output shape for conv transpose tests, add 1D and 3D cases --- python/tvm/relay/frontend/onnx.py | 2 -- tests/python/frontend/onnx/test_forward.py | 14 +++----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/python/tvm/relay/frontend/onnx.py b/python/tvm/relay/frontend/onnx.py index 49d58fa..9609cca 100644 --- a/python/tvm/relay/frontend/onnx.py +++ b/python/tvm/relay/frontend/onnx.py @@ -609,14 +609,12 @@ class ConvTranspose(OnnxOpConverter): output_padding = attr.get("output_padding", [0] * kndim) strides = attr["strides"] total_pad = [0] * kndim - print(kernel_shape, dilations, output_padding, strides) for i in range(kndim): total_pad[i] = ( output_padding[i] + ((kernel_shape[i] - 1) * dilations[i] + 1) - strides[i] ) left = [p // 2 for p in total_pad] right = [total_pad[i] - left[i] for i in range(kndim)] - print(left, right) if "LOWER" in attr["auto_pad"]: pad = left + right else: diff --git a/tests/python/frontend/onnx/test_forward.py b/tests/python/frontend/onnx/test_forward.py index 74cbc81..f31b939 100644 --- a/tests/python/frontend/onnx/test_forward.py +++ b/tests/python/frontend/onnx/test_forward.py @@ -2590,7 +2590,6 @@ def test_conv(): def verify_convtranspose_with_padding( x_shape, w_shape, - y_shape, padding, kernel_shape, strides, @@ -2626,12 +2625,12 @@ def verify_convtranspose_with_padding( helper.make_tensor_value_info("x", TensorProto.FLOAT, list(x_shape)), helper.make_tensor_value_info("W", TensorProto.FLOAT, list(w_shape)), ], - outputs=[helper.make_tensor_value_info("y", TensorProto.FLOAT, list(y_shape))], + outputs=[helper.make_tensor_value_info("y", TensorProto.FLOAT, ["?"] * len(x_shape))], ) model = helper.make_model(graph, producer_name="convtranspose_pad_test") - verify_with_ort(model, [x_shape, w_shape], [y_shape], use_vm=True, convert_to_static=True) + verify_with_ort(model, [x_shape, w_shape], use_vm=True, convert_to_static=True) def verify_convtranspose(x_shape, w_shape, y_shape, p, group=1): @@ -2678,12 +2677,11 @@ def test_convtranspose(): # TODO(mbrookhart): onnxruntime in CI only supports 2D, # find something else to test 1D and 3D against - for D in [2]: + for D in [1, 2, 3]: # Convolution with padding verify_convtranspose_with_padding( (1, 1) + repeat(5, D), (1, 1) + repeat(3, D), - (1, 1) + repeat(5, D), 2 * repeat(1, D), repeat(3, D), repeat(1, D), @@ -2693,7 +2691,6 @@ def test_convtranspose(): verify_convtranspose_with_padding( (1, 1) + repeat(5, D), (1, 1) + repeat(3, D), - (1, 1) + repeat(7, D), 2 * repeat(0, D), repeat(3, D), repeat(1, D), @@ -2703,7 +2700,6 @@ def test_convtranspose(): verify_convtranspose_with_padding( (1, 1) + repeat(5, D), (1, 1) + repeat(3, D), - (1, 1) + repeat(5, D), None, repeat(3, D), repeat(1, D), @@ -2714,7 +2710,6 @@ def test_convtranspose(): verify_convtranspose_with_padding( (1, 1) + repeat(5, D), (1, 1) + repeat(3, D), - (1, 1) + repeat(7, D), None, repeat(3, D), repeat(1, D), @@ -2725,7 +2720,6 @@ def test_convtranspose(): verify_convtranspose_with_padding( (1, 1) + repeat(5, D), (1, 1) + repeat(3, D), - (1, 1) + repeat(7, D), 2 * repeat(0, D), repeat(3, D), repeat(1, D), @@ -2736,7 +2730,6 @@ def test_convtranspose(): verify_convtranspose_with_padding( (1, 1) + repeat(5, D), (1, 1) + repeat(3, D), - (1, 1) + repeat(9, D), None, repeat(3, D), repeat(2, D), @@ -2748,7 +2741,6 @@ def test_convtranspose(): # verify_convtranspose_with_padding( # (1, 1) + repeat(5, D), # (1, 1) + repeat(3, D), - # (1, 1) + repeat(5, D), # 2 * repeat(2, D), # repeat(3, D), # repeat(1, D),