Skip to content

Commit 7607876

Browse files
generatedunixname499836121meta-codesync[bot]
authored andcommitted
Refactor generator methods (#187690)
Summary: Refactor `.close`, `.send` and `.throw` to follow CPython semantics. X-link: pytorch/pytorch#187690 Approved by: https://github.com/rtimpe Reviewed By: atalman Differential Revision: D111351451 fbshipit-source-id: de9db03eb939df7be52bd1b0212aa80bd495e949
1 parent ce084d4 commit 7607876

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • userbenchmark/dynamo/dynamobench/_dynamo

userbenchmark/dynamo/dynamobench/_dynamo/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5617,6 +5617,15 @@ def build_event(args: tuple[Any], kwargs: dict[Any, Any]) -> torch.Event:
56175617
return torch._C.Event(*args, **kwargs)
56185618

56195619

5620+
class FrameState(enum.Enum):
5621+
FRAME_CREATED = -3
5622+
FRAME_SUSPENDED = -2
5623+
FRAME_SUSPENDED_YIELD_FROM = -1
5624+
FRAME_EXECUTING = 0
5625+
FRAME_COMPLETED = 1
5626+
FRAME_CLEARED = 4
5627+
5628+
56205629
class CompileTimeInstructionCounter:
56215630
_counter: int = 0
56225631
_id: int = -1

0 commit comments

Comments
 (0)