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

tqchen pushed a commit to branch script/canonical-parser-df
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit ff9d243dfc18e74a77379d4e35bda51fbc900316
Author: Tianqi Chen <[email protected]>
AuthorDate: Wed Sep 23 04:19:22 2026 +0000

    Keep forward scalar parameter names outside annotation scope
---
 python/tvm/script/parser/transpile.py | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/python/tvm/script/parser/transpile.py 
b/python/tvm/script/parser/transpile.py
index ab18c87811..0153c8f1e1 100644
--- a/python/tvm/script/parser/transpile.py
+++ b/python/tvm/script/parser/transpile.py
@@ -1123,16 +1123,9 @@ class IRBuilderTranspiler(ast.NodeTransformer):
                     item.node,
                     dtype=ast.Constant(item.dtype),
                 )
-                if item.kind == "parameter":
-                    alias = self.fresh("_symbol")
-                    symbol_aliases[item.name] = alias
-                    declaration.append(
-                        ast.copy_location(
-                            ast.Assign([ast.Name(alias, ast.Store())], 
symbol), item.node
-                        )
-                    )
-                else:
-                    declaration.append(ast.copy_location(ast.Expr(symbol), 
item.node))
+                # The native map knows later scalar dtypes, but a later Python
+                # parameter name is not in annotation scope until its own arg.
+                declaration.append(ast.copy_location(ast.Expr(symbol), 
item.node))
         self.annotation_aliases = {**aliases, **symbol_aliases}
         constexpr_aliases = {}
         ordered = sorted(

Reply via email to