xref: /aosp_15_r20/external/pytorch/torch/_lazy/metrics.py (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1# mypy: allow-untyped-defs
2import torch._C._lazy
3
4
5def reset():
6    """Resets all metric counters."""
7    torch._C._lazy._reset_metrics()
8
9
10def counter_names():
11    """Retrieves all the currently active counter names."""
12    return torch._C._lazy._counter_names()
13
14
15def counter_value(name: str):
16    """Return the value of the counter with the speficied name"""
17    return torch._C._lazy._counter_value(name)
18
19
20def metrics_report():
21    """Return the combined (lazy core and backend) metric report"""
22    return torch._C._lazy._metrics_report()
23