mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
[3.13, dynamo] fix instruction line numbers (#130461)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130461 Approved by: https://github.com/jansel ghstack dependencies: #130459, #130460
This commit is contained in:
parent
82b2e7a253
commit
e2365c05d7
1 changed files with 5 additions and 1 deletions
|
|
@ -68,13 +68,17 @@ class Instruction:
|
|||
|
||||
|
||||
def convert_instruction(i: dis.Instruction) -> Instruction:
|
||||
if sys.version_info >= (3, 13):
|
||||
starts_line = i.line_number
|
||||
else:
|
||||
starts_line = i.starts_line
|
||||
return Instruction(
|
||||
i.opcode,
|
||||
i.opname,
|
||||
i.arg,
|
||||
i.argval,
|
||||
i.offset,
|
||||
i.starts_line,
|
||||
starts_line,
|
||||
i.is_jump_target,
|
||||
getattr(i, "positions", None),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue