Fix creation of BINARY_SUBSCR in Python 3.14+

Python 3.14 replaced `BINARY_SUBSCR` by `BINARY_OP(opcode=BN_SUBSCR)`


ghstack-source-id: bb1a5a75282944740aff65305454c22984fb9dfe
Pull-Request: https://github.com/pytorch/pytorch/pull/165864
This commit is contained in:
Guilherme Leobas
2025-10-19 17:06:13 +00:00
parent c73f5080de
commit 308081a8ae

View File

@ -74,6 +74,7 @@ from .bytecode_analysis import (
from .bytecode_transformation import (
cleaned_instructions,
create_binary_slice,
create_binary_subscr,
create_call_function,
create_call_function_ex,
create_copy,
@ -2724,7 +2725,7 @@ class InstructionTranslatorBase(
*create_copy(2),
# frame_values, frame N stack, frame_values
create_load_const(0),
create_instruction("BINARY_SUBSCR"),
create_binary_subscr(),
*create_binary_slice(0, 0, True),
# frame_values[0][0:0] = frame N stack
# frame_values left on top of stack