Skip to content

Commit

Permalink
Update test_dataloaders.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthsub committed Apr 29, 2021
1 parent deaf510 commit c4cbff9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/trainer/test_dataloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,14 +1112,6 @@ def test_dataloaders_load_only_once_val_interval(tmpdir):
expected_sequence = [
'val_dataloader',
'train_dataloader',
# This has subsequent calls to val_dataloader
# because the training loop runs the evaluation loop,
# which reloads the val dataloader again.
# We cannot yet rely on trainer.current_epoch=0 to skip reloading
# the val dataloader on the first epoch because this only tracks the training epoch
# meaning multiple passes through the validation data within a single training epoch
# would not have the datalodaer reloaded.
# This breaks the assumption behind reload_dataloaders_every_epoch=True
'val_dataloader',
'val_dataloader',
'val_dataloader',
Expand Down Expand Up @@ -1244,6 +1236,14 @@ def validation_step(self, batch, batch_idx):
expected_sequence = [
'train_dataloader',
'val_dataloader',
# This has subsequent calls to val_dataloader
# because the training loop runs the evaluation loop,
# which reloads the val dataloader again.
# We cannot yet rely on trainer.current_epoch=0 to skip reloading
# the val dataloader on the first epoch because this only tracks the training epoch
# meaning multiple passes through the validation data within a single training epoch
# would not have the datalodaer reloaded.
# This breaks the assumption behind reload_dataloaders_every_epoch=True
'val_dataloader',
'train_dataloader',
'val_dataloader',
Expand Down

0 comments on commit c4cbff9

Please sign in to comment.