[dynamo, 3.12] add BINARY/STORE_SLICE (#122455)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/122455
Approved by: https://github.com/jansel
ghstack dependencies: #122146, #122335, #122354, #122355, #122356, #122449
This commit is contained in:
William Wen 2024-03-26 15:52:50 -07:00 committed by PyTorch MergeBot
parent 7b13228038
commit bcdd0c6f59

View File

@ -1850,6 +1850,19 @@ class InstructionTranslatorBase(
def RETURN_GENERATOR(self, inst):
self.append_prefix_inst(inst)
# 3.12 opcodes
def BINARY_SLICE(self, inst):
# BUILD_SLICE
items = self.popn(2)
self.push(SliceVariable(items))
self.BINARY_SUBSCR(inst)
def STORE_SLICE(self, inst):
# BUILD SLICE
items = self.popn(2)
self.push(SliceVariable(items))
self.STORE_SUBSCR(inst)
def is_non_empty_graph(self):
if self.output.count_calls() > 1:
# perf optimization only