Fix iterating over a DummyLogger when `fast_dev_run > 0` (#10232)
This commit is contained in:
parent
70570f9eaa
commit
3f9dfe4949
|
@ -677,6 +677,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|||
- Fixed an issue with `pl.utilities.seed.reset_seed` converting the `PL_SEED_WORKERS` environment variable to `bool` ([#10099](https://github.com/PyTorchLightning/pytorch-lightning/pull/10099))
|
||||
|
||||
|
||||
- Fixed iterating over a logger collection when `fast_dev_run > 0` ([#10232](https://github.com/PyTorchLightning/pytorch-lightning/pull/10232))
|
||||
|
||||
|
||||
|
||||
## [1.4.9] - 2021-09-30
|
||||
|
||||
- Fixed `lr_find` to generate same results on multiple calls ([#9704](https://github.com/PyTorchLightning/pytorch-lightning/pull/9704))
|
||||
|
|
|
@ -510,6 +510,10 @@ class DummyLogger(LightningLoggerBase):
|
|||
# enables self.logger[0].experiment.add_image(...)
|
||||
return self
|
||||
|
||||
def __iter__(self):
|
||||
# if DummyLogger is substituting a logger collection, pretend it is empty
|
||||
yield from ()
|
||||
|
||||
|
||||
def merge_dicts(
|
||||
dicts: Sequence[Mapping],
|
||||
|
|
|
@ -227,6 +227,13 @@ def test_dummylogger_support_indexing():
|
|||
assert logger[0] == logger
|
||||
|
||||
|
||||
def test_dummylogger_empty_iterable():
|
||||
"""Test that DummyLogger represents an empty iterable."""
|
||||
logger = DummyLogger()
|
||||
for _ in logger:
|
||||
assert False
|
||||
|
||||
|
||||
def test_dummylogger_noop_method_calls():
|
||||
"""Test that the DummyLogger methods can be called with arbitrary arguments."""
|
||||
logger = DummyLogger()
|
||||
|
|
Loading…
Reference in New Issue