From cd43a40baf86e01f22a6515154a14e8c3894bd14 Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Thu, 15 Sep 2022 01:16:29 +0900 Subject: [PATCH] Enable intersphinx_mapping to PyTorch and domain libraries This will turn `:py:func:` directives to links to the corresponding API reference. --- conf.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/conf.py b/conf.py index 6f22c1a1749..830f5a1d3ea 100644 --- a/conf.py +++ b/conf.py @@ -66,10 +66,17 @@ # ones. extensions = [ 'sphinxcontrib.katex', + 'sphinx.ext.intersphinx', 'sphinx_copybutton', 'sphinx_gallery.gen_gallery', ] +intersphinx_mapping = { + "torch": ("https://pytorch.org/docs/stable/", None), + "torchaudio": ("https://pytorch.org/audio/stable/", None), + "torchtext": ("https://pytorch.org/text/stable/", None), + "torchvision": ("https://pytorch.org/vision/stable/", None), +} # -- Sphinx-gallery configuration --------------------------------------------