Skip to content

Commit 37f559e

Browse files
authored
Allow dataloader_idx_ in log names when add_dataloader_idx=False (#20987)
1 parent b324b98 commit 37f559e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lightning/pytorch/core/module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,10 @@ def log(
466466
)
467467

468468
# make sure user doesn't introduce logic for multi-dataloaders
469-
if "/dataloader_idx_" in name:
469+
if add_dataloader_idx and "/dataloader_idx_" in name:
470470
raise MisconfigurationException(
471471
f"You called `self.log` with the key `{name}`"
472-
" but it should not contain information about `dataloader_idx`"
472+
" but it should not contain information about `dataloader_idx` when `add_dataloader_idx=True`"
473473
)
474474

475475
value = apply_to_collection(value, (Tensor, numbers.Number), self.__to_tensor, name)

0 commit comments

Comments
 (0)