Skip to content

Commit e380568

Browse files
authored
Docs: enable nitpicky mode and fix broken links (#1300)
* Docs: enable nitpicky mode Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com> * Use intersphinx Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com> * Ruff Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com> * Fix or ignore remaining errors Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com> * Fix or ignore remaining errors Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com> --------- Signed-off-by: Adam J. Stewart <ajstewart426@gmail.com>
1 parent f72d8c2 commit e380568

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

docs/conf.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,21 @@ def get_version():
4646
extensions = [
4747
"sphinx.ext.autodoc",
4848
"sphinx.ext.coverage",
49+
"sphinx.ext.intersphinx",
4950
"sphinx.ext.napoleon",
5051
"sphinx.ext.viewcode",
5152
"sphinx.ext.mathjax",
5253
"autodocsumm",
5354
]
5455

56+
# Warn about all references where the target cannot be found.
57+
nitpicky = True
58+
nitpick_ignore = [
59+
# Undocumented classes
60+
("py:class", "torch.FloatTensor"),
61+
("py:class", "torch.LongTensor"),
62+
]
63+
5564
# Add any paths that contain templates here, relative to this directory.
5665
templates_path = ["_templates"]
5766

@@ -109,6 +118,12 @@ def get_version():
109118
autoclass_content = "both"
110119
autodoc_typehints = "description"
111120

121+
# sphinx.ext.intersphinx
122+
intersphinx_mapping = {
123+
"python": ("https://docs.python.org/3", None),
124+
"torch": ("https://docs.pytorch.org/docs/stable/", None),
125+
}
126+
112127
# --- Work around to make autoclass signatures not (*args, **kwargs) ----------
113128

114129

segmentation_models_pytorch/losses/tversky.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ class TverskyLoss(DiceLoss):
3131
multilabel modes. Weights do not need to be normalized.
3232
3333
Return:
34-
loss: torch.Tensor
35-
34+
torch.Tensor: loss
3635
"""
3736

3837
def __init__(

0 commit comments

Comments
 (0)