Agent skill · writing content · pytorch
document-public-apis
Document undocumented public APIs in PyTorch by removing functions from coverage_ignore_functions and coverage_ignore_classes in docs/source/conf.py, running Sphinx coverage, and adding the appropriate autodoc directives to the correct .md or .rst doc files. Use when a user asks to remove functions from conf.py ignore lists.
Why this skill is useful
Adds specific Sphinx autodoc directives and verification steps for documenting PyTorch APIs that the AI wouldn't reliably generate on its own.
What it needs
About 9k tokens when loaded. Last updated 2026-08-07. 102,253 stars on the source repository.
What this skill does
Document Public APIs This skill documents undocumented public APIs in PyTorch by removing entries from the coverage ignore lists in docs/source/conf.py and adding Sphinx autodoc directives (e.g., autosummary, currentmodule, autoclass, automodule) to the corresponding .md or .rst doc source files in docs/source/. "Documenting" means adding autodoc directives to doc source files — NEVER modifying Python source code. Do not add or edit docstrings in .py files. Your only job is to add the correct directive to the correct doc file. IMPORTANT: Before adding any function to the sphinx doctree, verify it has a real docstring. Use a quick Python check (e.g., python -c "from torch.module import func; print(bool(func.doc))") to confirm the function has actual documentation content — not just an empty docstring or a bare .. warning:: This API is experimental stub. Functions without meaningful docstrings should be left in the coverageignorefunctions/coverageignoreclasses lists. Adding undocumented functions to the doctree creates empty or near-empty pages that degrade documentation quality. Overview docs/source/conf.py contains two lists that suppress Sphinx coverage warnings for undocumented APIs: coverageignorefunctions: undocumented functions coverageignoreclasses: undocumented classes Entries are organized by module comment groups. Each group has a module label comment followed by the function/class names that belong to that module: There are two kinds of comments: Module label comments (# torch.ao.quantization.fx.convert): these label which module the entries below belong to. They appear on their own line before a group of entries. Inline comments (# deprecated, # documented as adaptivemaxpool1d): these appear after a string entry on the same line and explain why the entry is in the ignore list. The module label comment directly tells you: 1. Which module the functions belong to 2. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills pytorch/document-public-apis