-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix][TVMScript]fix var capturing order error (#13640)
This PR try to fix the following bug: ```python def test_var_capturing_order(): b = 2 @T.prim_func def test_case(): k: T.int32 = b if __name__ == "__main__": b = 1 ``` In the prim func `test_case`, the vaule of b should be 2, rather than 1. The parser wrongly uses global vars to shadow the value of nonlocal vars, which should be reversed. Co-authored-by: lightzhan-intellif <zhan.liang@intellif.com>
- Loading branch information
1 parent
ddb006e
commit 6161a8d
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters