forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
__name__
on a reconstructed NestedUserFunctionVariable (pytorch…
…#118768) ``` def f(): def g(): return () print(g.__name__) f() ``` The following script should print `g` (with or without torch.compile), but prints `f.<locals>.g` with torch.compile. The problem looks like we use the co_qualname when reconstructing the NestedUserFunctionVariable. I switched this over to use the co_name. Pull Request resolved: pytorch#118768 Approved by: https://github.com/yanboliang, https://github.com/jansel
- Loading branch information
1 parent
b0e65dd
commit 318e6ff
Showing
4 changed files
with
27 additions
and
33 deletions.
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
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