Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion torch/_dynamo/variables/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from ..exc import (
AttributeMutationError,
ObservedAttributeError,
ObservedUserStopIteration,
raise_observed_exception,
unimplemented_v2,
Unsupported,
Expand Down Expand Up @@ -2140,9 +2141,14 @@ def call_issubclass(self, tx: "InstructionTranslator", left_ty, right_ty):
def call_super(self, tx: "InstructionTranslator", a, b):
return variables.SuperVariable(a, b)

def call_next(self, tx: "InstructionTranslator", arg: VariableTracker):
def call_next(self, tx: "InstructionTranslator", *args):
arg = args[0]
try:
return arg.next_variable(tx)
except ObservedUserStopIteration:
if len(args) == 2:
return args[1]
raise
except Unsupported as ex:
if isinstance(arg, variables.BaseListVariable):
ex.remove_from_stats()
Expand Down
Loading