Revert "[dynamo, nested graph breaks] small fixes to resume function generation (#151056)"

This reverts commit 28e7aa21c522e92ea01a62dfdc5e3b74e398d8f0.

Reverted https://github.com/pytorch/pytorch/pull/151056 on behalf of https://github.com/malfet due to Not sure which one, but it broke test_error_messages, see 203b0efd63/1 ([comment](https://github.com/pytorch/pytorch/pull/151056#issuecomment-2916437433))
This commit is contained in:
PyTorch MergeBot
2025-05-28 13:53:50 +00:00
parent 9603d6382d
commit a75e3a02be
3 changed files with 76 additions and 2 deletions

View File

@ -1607,7 +1607,6 @@ def bytecode_from_template(fn, varname_map=None, noreturn=True, noprefix=True):
# If we don't reset starts_line, then the generated
# bytecode's line number will be based on fn's.
inst.starts_line = None
inst.positions = None
if varname_map and inst.argval in varname_map:
inst.argval = varname_map[inst.argval]