PyTorch Docstring Writing Guide
This skill describes how to write docstrings for functions and methods in the PyTorch project, following the conventions in torch/_tensor_docs.py and torch/nn/functional.py.
General Principles
- Use raw strings (
r"""...""") for all docstrings to avoid issues with LaTeX/math backslashes - Follow Sphinx/reStructuredText (reST) format for documentation
- Be concise but complete - include all essential information
- Always include *examples
[Description truncada. Veja o README completo no GitHub.]