Commit ff3f4a1
[dynamo] Fix aliasing issue for
Dynamo accidentally passed the original `ConstDictVariable.source` to
the result of `dict.copy(...)`, which caused aliasing issue when the
result escapes the graph (e.g., is a return value).
This patch fixes that and adds a regression test.
Pull Request resolved: pytorch#141715
Approved by: https://github.com/jansel
ghstack dependencies: pytorch#141713, pytorch#141714dict.copy that escapes the graph (pytorch#141715)1 parent 9eb0520 commit ff3f4a1
2 files changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2833 | 2833 | | |
2834 | 2834 | | |
2835 | 2835 | | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
2836 | 2849 | | |
2837 | 2850 | | |
2838 | 2851 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
316 | 318 | | |
317 | 319 | | |
318 | 320 | | |
| |||
0 commit comments