What problem does it solve?
This Skill streamlines the process of writing and updating docstrings for PyTorch functions and methods, ensuring they adhere to official PyTorch conventions. It eliminates the guesswork and manual effort involved in formatting, parameter documentation, and example inclusion, allowing developers to focus on code logic rather than documentation syntax.
Core Features & Use Cases
- Convention Adherence: Automatically guides the generation of docstrings following Sphinx/reStructuredText format, including raw strings, function signatures, and cross-references.
- Structured Documentation: Ensures inclusion of brief descriptions, mathematical formulas, notes, warnings,
Args, Keyword Args, Returns, and Examples sections.
- Use Case: When developing a new PyTorch function, use this Skill to quickly generate a compliant docstring template, ensuring all necessary sections are covered and correctly formatted, saving significant review time.
Quick Start
Write a docstring for a new PyTorch function my_new_function(input: Tensor, value: float) -> Tensor that applies a custom activation.