From 312e394654f7fd4b259e84bec6e5475e4d837f80 Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Mon, 27 Apr 2020 09:50:01 +0200 Subject: [PATCH] Update test_tensorboard.py --- tests/loggers/test_tensorboard.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/loggers/test_tensorboard.py b/tests/loggers/test_tensorboard.py index 937a233c9a..4e5974b2b1 100644 --- a/tests/loggers/test_tensorboard.py +++ b/tests/loggers/test_tensorboard.py @@ -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) +