mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
monitor: add docstrings to pybind interface (#71481)
Summary: This adds argument names and docstrings so the docs are a lot more understandable. Pull Request resolved: https://github.com/pytorch/pytorch/pull/71481 Test Plan: docs/tests CI should suffice  Reviewed By: edward-io Differential Revision: D33661255 Pulled By: d4l3k fbshipit-source-id: 686835dfe331b92a51f4409ec37f8ee6211e49d3 (cherry picked from commit 0a6accda1bec839bbc9387d80caa51194e81d828)
This commit is contained in:
committed by
PyTorch MergeBot
parent
84fe4279db
commit
26d54b4076
@ -15,6 +15,7 @@ from torch.monitor import (
|
||||
log_event,
|
||||
register_event_handler,
|
||||
unregister_event_handler,
|
||||
Stat,
|
||||
)
|
||||
|
||||
class TestMonitor(TestCase):
|
||||
@ -30,6 +31,7 @@ class TestMonitor(TestCase):
|
||||
(Aggregation.SUM, Aggregation.COUNT),
|
||||
timedelta(milliseconds=1),
|
||||
)
|
||||
self.assertIsInstance(s, Stat)
|
||||
self.assertEqual(s.name, "asdf")
|
||||
|
||||
s.add(2)
|
||||
@ -49,6 +51,7 @@ class TestMonitor(TestCase):
|
||||
(Aggregation.SUM, Aggregation.COUNT),
|
||||
3,
|
||||
)
|
||||
self.assertIsInstance(s, Stat)
|
||||
s.add(1)
|
||||
s.add(2)
|
||||
name = s.name
|
||||
|
Reference in New Issue
Block a user