From 308081a8ae21f3ef57b8429bc9060ef53fa6afae Mon Sep 17 00:00:00 2001 From: Guilherme Leobas Date: Sun, 19 Oct 2025 17:06:13 +0000 Subject: [PATCH] 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 --- torch/_dynamo/symbolic_convert.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/torch/_dynamo/symbolic_convert.py b/torch/_dynamo/symbolic_convert.py index 5815473d41f9..c7698eacfab0 100644 --- a/torch/_dynamo/symbolic_convert.py +++ b/torch/_dynamo/symbolic_convert.py @@ -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