Skip to content

Commit

Permalink
fix tqdm standalone test (#12493)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitgr7 authored Mar 28, 2022
1 parent 2230d59 commit d9b1ff3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/callbacks/test_tqdm_progress_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,12 +594,14 @@ def test_progress_bar_max_val_check_interval(
val_checks_per_epoch = total_train_batches / val_check_batch
total_val_batches = total_val_samples // (val_batch_size * world_size)
pbar_callback = trainer.progress_bar_callback
assert pbar_callback.val_progress_bar.n == total_val_batches
assert pbar_callback.val_progress_bar.total == total_val_batches
total_val_batches = total_val_batches * val_checks_per_epoch
assert pbar_callback.main_progress_bar.n == total_train_batches + total_val_batches
assert pbar_callback.main_progress_bar.total == total_train_batches + total_val_batches
assert pbar_callback.is_enabled == trainer.is_global_zero

if trainer.is_global_zero:
assert pbar_callback.val_progress_bar.n == total_val_batches
assert pbar_callback.val_progress_bar.total == total_val_batches
total_val_batches = total_val_batches * val_checks_per_epoch
assert pbar_callback.main_progress_bar.n == total_train_batches + total_val_batches
assert pbar_callback.main_progress_bar.total == total_train_batches + total_val_batches
assert pbar_callback.is_enabled


def test_get_progress_bar_metrics(tmpdir: str):
Expand Down

0 comments on commit d9b1ff3

Please sign in to comment.