Skip to content

Commit 312e394

Browse files
authored
Update test_tensorboard.py
1 parent cdbf2f4 commit 312e394

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/loggers/test_tensorboard.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,19 @@ def test_tensorboard_log_hyperparams(tmpdir):
7777
"layer": torch.nn.BatchNorm1d
7878
}
7979
logger.log_hyperparams(hparams)
80+
81+
def test_tensorboard_log_hparams_and_metrics
82+
logger = TensorBoardLogger(tmpdir)
83+
hparams = {
84+
"float": 0.3,
85+
"int": 1,
86+
"string": "abc",
87+
"bool": True,
88+
"dict": {'a': {'b': 'c'}},
89+
"list": [1, 2, 3],
90+
"namespace": Namespace(foo=Namespace(bar='buzz')),
91+
"layer": torch.nn.BatchNorm1d
92+
}
93+
metrics = {'abc': torch.tensor([0.54])}
94+
logger.log_hyperparams(hparams, metrics)
95+

0 commit comments

Comments
 (0)