This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 46aaf61119 [BugFix] add the default value for DFT in ONNX frontend 
(#16659)
46aaf61119 is described below

commit 46aaf611196ebfb9706bfa85eee24239d59e5f5f
Author: Qingchao Shen <[email protected]>
AuthorDate: Mon Mar 4 21:57:06 2024 +0800

    [BugFix] add the default value for DFT in ONNX frontend (#16659)
---
 python/tvm/relay/frontend/onnx.py          | 6 +++---
 tests/python/frontend/onnx/test_forward.py | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/python/tvm/relay/frontend/onnx.py 
b/python/tvm/relay/frontend/onnx.py
index b95afae1d1..17329cfb15 100644
--- a/python/tvm/relay/frontend/onnx.py
+++ b/python/tvm/relay/frontend/onnx.py
@@ -4809,9 +4809,9 @@ class DFT(OnnxOpConverter):
     @classmethod
     def _impl_v17(cls, inputs, attr, params):
         # ************************* Read attrs *************************
-        axis = attr.get("axis")
-        inverse = attr.get("inverse")
-        onesided = attr.get("onesided")
+        axis = attr.get("axis", 1)
+        inverse = attr.get("inverse", 0)
+        onesided = attr.get("onesided", 0)
 
         # ************************* Read inputs ************************
         input_tensor = inputs[0]
diff --git a/tests/python/frontend/onnx/test_forward.py 
b/tests/python/frontend/onnx/test_forward.py
index 543aa7f518..4bfa497034 100644
--- a/tests/python/frontend/onnx/test_forward.py
+++ b/tests/python/frontend/onnx/test_forward.py
@@ -8238,7 +8238,7 @@ def test_dft(target, dev):
     D = 7
 
     for axis in list(range(1, n)) + [-2]:
-        for inverse, onesided in [(0, 0), (0, 1), (1, 0)]:
+        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]

Reply via email to