forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_monitor.pyi
More file actions
58 lines (49 loc) · 1.41 KB
/
Copy path_monitor.pyi
File metadata and controls
58 lines (49 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Defined in torch/csrc/monitor/python_init.cpp
import datetime
from collections.abc import Callable
from enum import Enum
from types import TracebackType
class Aggregation(Enum):
VALUE = ...
MEAN = ...
COUNT = ...
SUM = ...
MAX = ...
MIN = ...
class Stat:
name: str
count: int
def __init__(
self,
name: str,
aggregations: list[Aggregation],
window_size: int,
max_samples: int = -1,
) -> None: ...
def add(self, v: float) -> None: ...
def get(self) -> dict[Aggregation, float]: ...
class Event:
name: str
timestamp: datetime.datetime
data: dict[str, int | float | bool | str]
def __init__(
self,
name: str,
timestamp: datetime.datetime,
data: dict[str, int | float | bool | str],
) -> None: ...
def log_event(e: Event) -> None: ...
class EventHandlerHandle: ...
def register_event_handler(handler: Callable[[Event], None]) -> EventHandlerHandle: ...
def unregister_event_handler(handle: EventHandlerHandle) -> None: ...
class _WaitCounterTracker:
def __enter__(self) -> None: ...
def __exit__(
self,
exc_type: type[BaseException] | None = None,
exc_value: BaseException | None = None,
traceback: TracebackType | None = None,
) -> None: ...
class _WaitCounter:
def __init__(self, key: str) -> None: ...
def guard(self) -> _WaitCounterTracker: ...