Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwharris committed Mar 2, 2020
1 parent d680726 commit c2d1315
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
13 changes: 11 additions & 2 deletions pytorch_lightning/loggers/neptune.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ def log_hyperparams(self, params: argparse.Namespace):
self.experiment.set_property(f'param__{key}', val)

@rank_zero_only
def log_metrics(self, metrics: Dict[str, Union[torch.Tensor, float]], step: Optional[int] = None):
def log_metrics(
self,
metrics: Dict[str, Union[torch.Tensor, float]],
step: Optional[int] = None
):
"""Log metrics (numeric values) in Neptune experiments
Args:
Expand Down Expand Up @@ -198,7 +202,12 @@ def version(self) -> str:
return self.experiment.id

@rank_zero_only
def log_metric(self, metric_name: str, metric_value: Union[torch.Tensor, float, str], step: Optional[int] = None):
def log_metric(
self,
metric_name: str,
metric_value: Union[torch.Tensor, float, str],
step: Optional[int] = None
):
"""Log metrics (numeric values) in Neptune experiments
Args:
Expand Down
5 changes: 4 additions & 1 deletion pytorch_lightning/loggers/tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ class TensorBoardLogger(LightningLoggerBase):
"""
NAME_CSV_TAGS = 'meta_tags.csv'

def __init__(self, save_dir: str, name: Optional[str] = "default", version: Optional[Union[int, str]] = None, **kwargs):
def __init__(
self, save_dir: str, name: Optional[str] = "default",
version: Optional[Union[int, str]] = None, **kwargs
):
super().__init__()
self.save_dir = save_dir
self._name = name
Expand Down
3 changes: 2 additions & 1 deletion tests/loggers/test_tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def test_tensorboard_named_version(tmpdir):
logger.log_hyperparams({"a": 1, "b": 2}) # Force data to be written

assert logger.version == expected_version
# Could also test existence of the directory but this fails in the "minimum requirements" test setup
# Could also test existence of the directory but this fails
# in the "minimum requirements" test setup


def test_tensorboard_no_name(tmpdir):
Expand Down

0 comments on commit c2d1315

Please sign in to comment.