Skip to content

Conversation

@ritoban23
Copy link

@ritoban23 ritoban23 commented Nov 13, 2025

What does this PR do?

Fixes a documentation rendering bug in trainer.fit where :rtype: None was incorrectly displayed.
The fix wraps the "For more information about multiple dataloaders" text in a proper RST .. note:: directive, ensuring correct Sphinx formatting and preventing spurious :rtype: output.

Fixes #21356

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

📚 Documentation preview 📚: https://pytorch-lightning--21362.org.readthedocs.build/en/21362/

@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Nov 13, 2025
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79%. Comparing base (b15d394) to head (a4315bf).
✅ All tests successful. No failed tests found.

❗ There is a different number of reports uploaded between BASE (b15d394) and HEAD (a4315bf). Click for more details.

HEAD has 1053 uploads less than BASE
Flag BASE (b15d394) HEAD (a4315bf)
cpu 264 27
python3.10 59 6
lightning_fabric 58 0
pytest 132 0
lightning 146 15
python3.12.7 89 9
python3.11 58 6
python3.12 29 3
python 29 3
pytorch2.2.2 14 3
pytest-full 132 27
pytorch2.1 29 6
pytorch_lightning 60 12
pytorch2.5.1 15 3
pytorch2.7 15 3
pytorch2.4.1 15 3
pytorch2.6 15 3
pytorch2.8 15 3
pytorch2.3 14 3
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #21362     +/-   ##
=========================================
- Coverage      87%      79%     -8%     
=========================================
  Files         269      266      -3     
  Lines       23744    23689     -55     
=========================================
- Hits        20572    18671   -1901     
- Misses       3172     5018   +1846     

@deependujha
Copy link
Collaborator

Hi @ritoban23, thanks for choosing to make PyTorch Lightning more awesome. Can you please look at failing doc tests?

@turbotimon
Copy link

turbotimon commented Nov 14, 2025

I'm wondering why the note is necessary and why it is not the same issue e.g. here:

See :ref:`Lightning inference section<deploy/production_basic:Predict step with your LightningModule>` for more.

However, it may would fix the problem and be more concise to just move the "For more.." sentence up, just below the parameters, like it is done in validate, test and predict:

weights_only: Defaults to ``None``. If ``True``, restricts loading to ``state_dicts`` of plain
``torch.Tensor`` and other primitive types. If loading a checkpoint from a trusted source that contains
an ``nn.Module``, use ``weights_only=False``. If loading checkpoint from an untrusted source, we
recommend using ``weights_only=True``. For more information, please refer to the
`PyTorch Developer Notes on Serialization Semantics <https://docs.pytorch.org/docs/main/notes/serialization.html#id3>`_.
For more information about multiple dataloaders, see this :ref:`section <multiple-dataloaders>`.
Returns:
List of dictionaries with metrics logged during the validation phase, e.g., in model- or callback hooks
like :meth:`~lightning.pytorch.LightningModule.validation_step` etc.
The length of the list corresponds to the number of validation dataloaders used.
Raises:
TypeError:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pl Generic label for PyTorch Lightning package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trainer.fit render bug

3 participants