mirror of
https://github.com/pytorch/pytorch.git
synced 2026-10-28 18:56:51 +08:00
The 11 `torch.utils.*` pages (`data`, `checkpoint`, `benchmark_utils`, `tensorboard`, ...) sit at the docs root and are listed as siblings of `torch.utils` in the top-level Python API toctree. This moves them to `docs/source/utils/` and lists them in a toctree in `utils.md`, as #200857 and #201160 did for `torch.distributed`, so the sidebar shows them as children of `torch.utils`. `benchmark_utils` and `jit_utils` become `utils/benchmark` and `utils/jit`. Old URLs redirect via `redirects.py`. Autosummary toctrees in the moved pages point at `../generated` so the generated API pages keep their URLs. The only other content change is the relative image path in `utils/tensorboard.md`. Fixes the tensorboard writer docstring images to use source-absolute `/_static/...` paths so they resolve from the moved page. Test plan: ``` lintrunner docs/source/redirects.py docs/source/utils.md docs/source/utils/*.md docs/source/pytorch-api.md cd docs && sphinx-build -M html source build -j 24 -T --keep-going -D katex_prerender=0 ``` Compared warnings and HTML file lists against a build of the base commit: no new warnings; every old page exists or redirects to an existing page; the tensorboard figure resolves. Authored with an AI assistant (Claude). Pull Request resolved: https://github.com/pytorch/pytorch/pull/201404 Approved by: https://github.com/kapilsh ghstack dependencies: #201403