metrics.py 545 B

12345678910111213141516171819202122
  1. # mypy: allow-untyped-defs
  2. import torch._C._lazy
  3. def reset():
  4. """Resets all metric counters."""
  5. torch._C._lazy._reset_metrics()
  6. def counter_names():
  7. """Retrieves all the currently active counter names."""
  8. return torch._C._lazy._counter_names()
  9. def counter_value(name: str):
  10. """Return the value of the counter with the specified name"""
  11. return torch._C._lazy._counter_value(name)
  12. def metrics_report():
  13. """Return the combined (lazy core and backend) metric report"""
  14. return torch._C._lazy._metrics_report()