metrics.py 518 B

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