Docs: avoid unresolved torch.jit Sphinx refs to fix the CICD doc build failure.#21621
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #21621 +/- ##
=========================================
- Coverage 87% 79% -8%
=========================================
Files 270 267 -3
Lines 23895 23836 -59
=========================================
- Hits 20675 18762 -1913
- Misses 3220 5074 +1854 |
| provided, or the model has :attr:`example_input_array` set. If you would like to customize the modules that are | ||
| scripted you should override this method. In case you want to return multiple modules, we recommend using a | ||
| dictionary. | ||
| """By default compiles the whole model to a ``torch.jit.ScriptModule``. If you want to use tracing, please |
There was a problem hiding this comment.
great work, but my approach was to ignore them: https://github.com/Lightning-AI/pytorch-lightning/pull/21523/changes#diff-9a7ea5a9d5aab95e64e812eef353aba08036e2416be44508d84bd6298bdab6a9
There was a problem hiding this comment.
I think this pr is probably better anyway, since it was coming from deprecated code. I actually remembered the ignore approach from your PR as well.
There was a problem hiding this comment.
in that case, either this method should be discouraged, or removed completely.
…doc build failure. (Lightning-AI#21621)" This reverts commit 44fd142.
What does this PR do?
Fixes #21620
This PR fixes the docs build failure caused by unresolved Sphinx cross-references in
LightningModule.to_torchscript().The immediate source of the warnings is Lightning's docstring in
src/lightning/pytorch/core/module.py, which references deprecatedtorch.jitobjects with Sphinx roles:torch.jit.ScriptModuletorch.jit.scripttorch.jit.tracetorch.jitThese references appear to have become unresolved after upstream PyTorch documentation / intersphinx changes following TorchScript deprecation.
This change keeps the fix targeted by replacing only those broken external
torch.jitSphinx roles with code literals. Other working cross-references remain unchanged.No breaking changes.
Before submitting
Local verification:
./.venv/bin/python -m py_compile src/lightning/pytorch/core/module.py📚 Documentation preview 📚: https://pytorch-lightning--21621.org.readthedocs.build/en/21621/