Skip to content

Docs: highlight key optimization code lines with :emphasize-lines:#21568

Open
tsubasakong wants to merge 2 commits intoLightning-AI:masterfrom
tsubasakong:docs/12119_emphasize-lines
Open

Docs: highlight key optimization code lines with :emphasize-lines:#21568
tsubasakong wants to merge 2 commits intoLightning-AI:masterfrom
tsubasakong:docs/12119_emphasize-lines

Conversation

@tsubasakong
Copy link

@tsubasakong tsubasakong commented Mar 6, 2026

What does this PR do?

Fixes #12119.

This PR adds Sphinx :emphasize-lines: directives to key Python examples in the optimization docs so readers can quickly spot the important lines:

  • Automatic optimization loop internals (closure / step points)
  • Accessing the wrapped optimizer vs. raw optimizer
  • Custom LR scheduler integration
  • Gradient clipping customization
  • estimated_stepping_batches usage with OneCycleLR

These are docs-only changes (no behavior changes).

Before submitting
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing?
  • Did you verify relevant checks locally for this docs-only change?

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

@github-actions github-actions bot added docs Documentation related pl Generic label for PyTorch Lightning package labels Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation related pl Generic label for PyTorch Lightning package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use :emphasize-lines: in sphinx docs to highlight code.

1 participant