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

tlopex 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 36a82f5159 [BugFix][TVMScript] Add `doc.keyword` handling for 
`ExprEvaluator._visit` (#19352)
36a82f5159 is described below

commit 36a82f515960b1460909ffebfa9466b71c5acd95
Author: liggest <[email protected]>
AuthorDate: Mon Apr 6 00:27:09 2026 +0800

    [BugFix][TVMScript] Add `doc.keyword` handling for `ExprEvaluator._visit` 
(#19352)
    
    Add handling for `doc.keyword` nodes in `ExprEvaluator._visit` to ensure
    expressions (e.g. `BoolOp`) in keyword arguments are processed with
    correct evaluation methods.
    
    Fix #18972 . For more details, please refer to this issue.
---
 python/tvm/script/parser/core/evaluator.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/python/tvm/script/parser/core/evaluator.py 
b/python/tvm/script/parser/core/evaluator.py
index 3b940fa6d2..04605fd1ec 100644
--- a/python/tvm/script/parser/core/evaluator.py
+++ b/python/tvm/script/parser/core/evaluator.py
@@ -222,6 +222,8 @@ class ExprEvaluator:
             doc.Constant | doc.expr_context | doc.operator | doc.boolop | 
doc.unaryop | doc.cmpop,
         ):
             return node
+        if isinstance(node, doc.keyword):
+            return doc.keyword(arg=node.arg, value=self._visit(node.value))
         if not isinstance(node, doc.expr | doc.Slice):
             return node
         if isinstance(node, doc.Lambda):

Reply via email to