Update test_tensorboard.py

This commit is contained in:
Justus Schock 2020-04-27 09:50:01 +02:00 committed by GitHub
parent cdbf2f4a37
commit 312e394654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -77,3 +77,19 @@ def test_tensorboard_log_hyperparams(tmpdir):
"layer": torch.nn.BatchNorm1d
}
logger.log_hyperparams(hparams)
def test_tensorboard_log_hparams_and_metrics
logger = TensorBoardLogger(tmpdir)
hparams = {
"float": 0.3,
"int": 1,
"string": "abc",
"bool": True,
"dict": {'a': {'b': 'c'}},
"list": [1, 2, 3],
"namespace": Namespace(foo=Namespace(bar='buzz')),
"layer": torch.nn.BatchNorm1d
}
metrics = {'abc': torch.tensor([0.54])}
logger.log_hyperparams(hparams, metrics)