Skip to content

Docs: avoid duplicate target links#1299

Merged
qubvel merged 5 commits intoqubvel-org:mainfrom
adamjstewart:docs/links
Mar 19, 2026
Merged

Docs: avoid duplicate target links#1299
qubvel merged 5 commits intoqubvel-org:mainfrom
adamjstewart:docs/links

Conversation

@adamjstewart
Copy link
Copy Markdown
Collaborator

@adamjstewart adamjstewart commented Mar 19, 2026

Both docs/models.rst and smp/decoders/*/model.py have hyperlink targets with the same name. A single underscore creates a named hyperlink, which must be unique. A double underscore creates an anonymous hyperlink, which does not have to be unique. Fixes warnings in RtD CI like:

/home/docs/checkouts/readthedocs.org/user_builds/smp/checkouts/latest/docs/../segmentation_models_pytorch/decoders/unet/model.py:docstring of segmentation_models_pytorch.decoders.unet.model.Unet:86: WARNING: Duplicate explicit target name: "unet". [docutils]

Reference: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#hyperlink-targets

Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com>
Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com>
Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com>
Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com>
Comment thread docs/save_load.rst

By following these steps, you can easily save, share, and load your models, facilitating collaboration and reproducibility in your projects. Don't forget to replace the placeholders with your actual model paths and names.

|colab-badge|
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one of these badges was being rendered before.

``torch.nn.Module``: **DeepLabV3**

.. _DeeplabV3:
https://arxiv.org/abs/1706.05587
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We weren't even using this link before.


class FPN(SegmentationModel):
"""FPN_ is a fully convolution neural network for image semantic segmentation.
"""`FPN`__ is a fully convolution neural network for image semantic segmentation.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This resulted in an extra FPN_ showing up in the docs.

Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com>
@adamjstewart adamjstewart marked this pull request as ready for review March 19, 2026 13:52
@qubvel qubvel merged commit 506a444 into qubvel-org:main Mar 19, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants