Skip to content

Commit

Permalink
Addres Adrian's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca committed Jul 19, 2021
1 parent 741a92f commit 6941d93
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/trainer/properties/log_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,16 @@ def test_logdir_custom_logger(tmpdir):

def test_logdir_logger_collection(tmpdir):
"""Tests that the logdir equals the default_root_dir when the logger is a LoggerCollection"""
expected = tmpdir
model = TestModel(expected)

default_root_dir = tmpdir / "default_root_dir"
save_dir = tmpdir / "save_dir"
model = TestModel(default_root_dir)
trainer = Trainer(
default_root_dir=tmpdir, max_steps=2, logger=[TensorBoardLogger(save_dir=tmpdir, name='custom_logs')]
default_root_dir=default_root_dir,
max_steps=2,
logger=[TensorBoardLogger(save_dir=save_dir, name='custom_logs')]
)

assert isinstance(trainer.logger, LoggerCollection)
assert trainer.log_dir == expected
assert trainer.log_dir == default_root_dir

trainer.fit(model)
assert trainer.log_dir == expected
assert trainer.log_dir == default_root_dir

0 comments on commit 6941d93

Please sign in to comment.