Skip to content

Commit 5025be7

Browse files
authored
Fix missing docs (Lightning-AI#2659)
* dataloader_idx typo * typo * update test_step docs * missing optimizer_idx
1 parent ee1488e commit 5025be7

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

.github/BECOMING_A_CORE_CONTRIBUTOR.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ First and foremost, you'll be evaluated against [these core values](https://gith
1111
### The bar for joining the team
1212
Lightning is being used to solve really hard problems at the top AI labs in the world. As such, the bar for adding team members is extremely high. Candidates must have solid engineering skills, have a good eye for user experience, and must be a power user of Lightning and PyTorch.
1313

14-
With that said, the Lightning team will be diverse and a reflection of an inclusive AI community. You don't have to be an engineer to conntribute! Scientists with great usability intuition and PyTorch ninja skills are welcomed!
14+
With that said, the Lightning team will be diverse and a reflection of an inclusive AI community. You don't have to be an engineer to contribute! Scientists with great usability intuition and PyTorch ninja skills are welcomed!
1515

1616
### Responsibilities:
1717
The responsibilities mainly revolve around 3 things.

docs/source/introduction_guide.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ With your own
903903

904904
class LitMNIST(LightningModule):
905905

906-
def backward(self, use_amp, loss, optimizer):
906+
def backward(self, use_amp, loss, optimizer, optimizer_idx):
907907
# do a custom way of backward
908908
loss.backward(retain_graph=True)
909909

pytorch_lightning/core/lightning.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ def validation_step(self, batch, batch_idx):
470470
.. code-block:: python
471471
472472
# CASE 2: multiple validation datasets
473-
def validation_step(self, batch, batch_idx, dataset_idx):
474-
# dataset_idx tells you which dataset this is.
473+
def validation_step(self, batch, batch_idx, dataloader_idx):
474+
# dataloader_idx tells you which dataset this is.
475475
476476
Note:
477477
If you don't need to validate you don't need to implement this method.
@@ -698,8 +698,8 @@ def test_step(self, batch, batch_idx):
698698
.. code-block:: python
699699
700700
# CASE 2: multiple test datasets
701-
def test_step(self, batch, batch_idx, dataset_idx):
702-
# dataset_idx tells you which dataset this is.
701+
def test_step(self, batch, batch_idx, dataloader_idx):
702+
# dataloader_idx tells you which dataset this is.
703703
704704
Note:
705705
If you don't need to validate you don't need to implement this method.
@@ -1426,10 +1426,17 @@ def test_dataloader(self):
14261426
14271427
return loader
14281428
1429+
# can also return multiple dataloaders
1430+
def test_dataloader(self):
1431+
return [loader_a, loader_b, ..., loader_n]
1432+
14291433
Note:
14301434
If you don't need a test dataset and a :meth:`test_step`, you don't need to implement
14311435
this method.
14321436
1437+
Note:
1438+
In the case where you return multiple test dataloaders, the :meth:`test_step`
1439+
will have an argument ``dataloader_idx`` which matches the order here.
14331440
"""
14341441

14351442
def val_dataloader(self) -> Union[DataLoader, List[DataLoader]]:
@@ -1481,7 +1488,7 @@ def val_dataloader(self):
14811488
14821489
Note:
14831490
In the case where you return multiple validation dataloaders, the :meth:`validation_step`
1484-
will have an argument ``dataset_idx`` which matches the order here.
1491+
will have an argument ``dataloader_idx`` which matches the order here.
14851492
"""
14861493

14871494
def summarize(self, mode: str = ModelSummary.MODE_DEFAULT) -> ModelSummary:

0 commit comments

Comments
 (0)