You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow setting mininterval for TQDM progress bar (meta-pytorch#987)
Summary:
Pull Request resolved: meta-pytorch#987
This uses `tqdm`'s exposes built-in `mininterval` to the callback -- this allows the user to control the TQDM update rate based on the number of seconds rather than the number of iteration steps.
Reviewed By: JKSenthil
Differential Revision: D72068311
fbshipit-source-id: 91105da3db1dbadac5b89f9865406f75035dccb6
Copy file name to clipboardExpand all lines: torchtnt/utils/tqdm.py
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ def create_progress_bar(
25
25
num_steps_completed: int,
26
26
max_steps: Optional[int],
27
27
max_steps_per_epoch: Optional[int],
28
+
mininterval: float|None=None,
28
29
file: Optional[Union[TextIO, io.StringIO]] =None,
29
30
) ->tqdm:
30
31
"""Constructs a :func:`tqdm` progress bar. The number of steps in an epoch is inferred from the dataloader, num_steps_completed, max_steps and max_steps_per_epoch.
@@ -36,6 +37,7 @@ def create_progress_bar(
36
37
num_steps_completed: an integer for the number of steps completed so far in the loop.
37
38
max_steps: an optional integer for the number of max steps in the loop.
38
39
max_steps_per_epoch: an optional integer for the number of max steps per epoch.
40
+
mininterval: Minimum display update interval (in seconds). If None, use TQDM's default.
39
41
file: specifies where to output the progress messages (default: sys.stderr)
0 commit comments