From 66e71466b32def3047a95c444bcf1fcc6ae295d8 Mon Sep 17 00:00:00 2001 From: Qingchao Shen Date: Fri, 23 Feb 2024 13:05:27 +0800 Subject: [PATCH 1/4] Update onnx.py --- python/tvm/relay/frontend/onnx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tvm/relay/frontend/onnx.py b/python/tvm/relay/frontend/onnx.py index ddd0d34c5c5b..3c46404c484a 100644 --- a/python/tvm/relay/frontend/onnx.py +++ b/python/tvm/relay/frontend/onnx.py @@ -4809,7 +4809,7 @@ class DFT(OnnxOpConverter): @classmethod def _impl_v17(cls, inputs, attr, params): # ************************* Read attrs ************************* - axis = attr.get("axis") + axis = attr.get("axis", 1) inverse = attr.get("inverse") onesided = attr.get("onesided") From 490865eca7d866328ff1c5158ecd4b6c7cc82e26 Mon Sep 17 00:00:00 2001 From: Qingchao Shen Date: Fri, 23 Feb 2024 13:09:41 +0800 Subject: [PATCH 2/4] Update onnx.py --- python/tvm/relay/frontend/onnx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/tvm/relay/frontend/onnx.py b/python/tvm/relay/frontend/onnx.py index 3c46404c484a..59c2cb1b796b 100644 --- a/python/tvm/relay/frontend/onnx.py +++ b/python/tvm/relay/frontend/onnx.py @@ -4810,8 +4810,8 @@ class DFT(OnnxOpConverter): def _impl_v17(cls, inputs, attr, params): # ************************* Read attrs ************************* axis = attr.get("axis", 1) - inverse = attr.get("inverse") - onesided = attr.get("onesided") + inverse = attr.get("inverse", 0) + onesided = attr.get("onesided", 0) # ************************* Read inputs ************************ input_tensor = inputs[0] From 2aeb41a4c8413b433caeefb7cd20ea1254db1d0e Mon Sep 17 00:00:00 2001 From: Qingchao Shen Date: Fri, 23 Feb 2024 19:36:58 +0800 Subject: [PATCH 3/4] Update test_forward.py --- tests/python/frontend/onnx/test_forward.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/python/frontend/onnx/test_forward.py b/tests/python/frontend/onnx/test_forward.py index 543aa7f5189f..2101c17023e5 100644 --- a/tests/python/frontend/onnx/test_forward.py +++ b/tests/python/frontend/onnx/test_forward.py @@ -8237,8 +8237,8 @@ def verify_dft( n = 2 D = 7 - for axis in list(range(1, n)) + [-2]: - for inverse, onesided in [(0, 0), (0, 1), (1, 0)]: + for axis in list(range(1, n)) + [-2, None]: + for inverse, onesided in [(0, 0), (0, 1), (1, 0), (None, None)]: for n_fft in [D, D - 1, D + 1]: for c in [1, 2]: input_shape = [batch_size] + n * [D] + [c] From 5fc9044b15d265eeb9d281fbbbb1c3a1062f8dc5 Mon Sep 17 00:00:00 2001 From: Qingchao Shen Date: Mon, 4 Mar 2024 14:57:18 +0800 Subject: [PATCH 4/4] Update test_forward.py --- tests/python/frontend/onnx/test_forward.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/frontend/onnx/test_forward.py b/tests/python/frontend/onnx/test_forward.py index 2101c17023e5..4bfa4970349c 100644 --- a/tests/python/frontend/onnx/test_forward.py +++ b/tests/python/frontend/onnx/test_forward.py @@ -8237,7 +8237,7 @@ def verify_dft( n = 2 D = 7 - for axis in list(range(1, n)) + [-2, None]: + for axis in list(range(1, n)) + [-2]: for inverse, onesided in [(0, 0), (0, 1), (1, 0), (None, None)]: for n_fft in [D, D - 1, D + 1]: for c in [1, 2]: