docstring - Write PyTorch Docstrings Following Conventions
Write docstrings for PyTorch functions and methods following PyTorch Sphinx/reStructuredText conventions.
Tags
Updated: 2026-06-30Capabilities
Typical Inputs
Typical Outputs
What this skill does
- Write PyTorch function docstrings
- Format docstrings as raw strings
- Document function parameters with types
- Add mathematical formulas in docstrings
- Insert Sphinx cross-references
- Add notes and warnings sections
- Include code examples in docstrings
- Document in-place variants and aliases
Inputs
- PyTorch function or method source code
- Function parameter names and types
- Return type information
- Related PyTorch classes and functions for cross-referencing
Outputs
- Sphinx-formatted docstring text
- Documentation strings with parameter sections, examples, and cross-references
Requirements
- Access to PyTorch codebase
- Sphinx/reStructuredText format support
