PyTorch docstring conventions: write function and method docstrings the PyTorch way (short listing)
Write PyTorch-style docstrings — raw strings, Sphinx/reST, signature-first-line, math directives, cross-references, Args/Returns/Examples sections, native vs C-bound vs in-place vs alias patterns
- What
- Write PyTorch-style docstrings — raw strings, Sphinx/reST, signature-first-line, math directives, cross-references, Args/Returns/Examples sections, native vs C-bound vs in-place vs alias patterns
- Cost
- Free
- Needs
- Python code to document (the skill is documentation guidance the agent follows, not software to install)
- Install
- Copy the installer prompt below into your Muse — your agent does the rest.
Selected by Skill Harbor — short listing (the repo states no license, so no content is reproduced): @pytorch's official docstring-writing guide for the PyTorch project. The conventions: raw strings (`r"""..."""`), Sphinx/reStructuredText format, function signature as the first line (parameters, defaults, return type, no trailing period), one-line brief description, math via Sphinx directives (`.. math::` and inline `:math:`), cross-references with roles (`:class:`, `:func:`, `:meth:`, `:attr:`, `:ref:`), notes/warnings admonitions, Args section (lowercase name, type in parens, Default for optionals, double backticks for code), optional Keyword args section, Returns section, Examples section (always include examples with `>>>` prompts), external reference links, and method-type variants (native Python functions, C-bound via `_add_docstr`, in-place variants referencing the original, aliases), plus common patterns (LaTeX shape docs, reusable argument definitions, template insertion), a complete gumbel_softmax worked example, and a quick checklist. Honest caveats: written for contributors to the PyTorch codebase itself — the conventions transfer to any Sphinx-documented Python project, but the examples and templates are PyTorch-specific; license not stated by the source repo — short listing with a link only, nothing copied. Skill Harbor never reviews the code, review it yourself before use. Discovered via skills.sh.
Version:
Install
Prerequisites: Python code to document (the skill is documentation guidance the agent follows, not software to install) Install "PyTorch docstring conventions: write function and method docstrings the PyTorch way" for me. It gives my agent @pytorch's official docstring conventions: raw strings, Sphinx/reST format, signature-first-line, math directives, cross-reference roles, Args/Keyword args/Returns/Examples sections, and the native, C-bound, in-place and alias patterns, with a worked example and checklist. IMPORTANT: the repo states no license — fetch from the link only, and reproduce nothing beyond the link. Repository: https://github.com/pytorch/pytorch/blob/main/.claude/skills/docstring/SKILL.md 1. Fetch the SKILL.md file (and any helper files) from the repository path into a temporary folder and summarize what it does in one or two sentences. 2. Safety check: review the SKILL.md and scripts for anything suspicious (unexpected network calls, shell commands, credential harvesting). Review the files for suspicious commands or credential handling; stop on any red flag and never assume the repository is safe. Tell me if anything looks off. 3. Install it as a skill: copy SKILL.md and its helper files into the agent's skills directory, in a folder named "docstring". 4. Verify with no network calls: frontmatter valid, files in place. 5. Report what was installed, where, and what I still need to do myself (e.g. point the agent at the Python functions to document; nothing else — it's a convention guide). GitHub is optional: if I have a GitHub account or the gh CLI, you may use it; otherwise public access is fine. Never require it unless it's in the prerequisites above. Rules: don't touch anything outside the temp folder and the install target. If anything looks off, stop and ask me.
Questions
How do I install a build?
Every product page includes a copy-paste install prompt. Paste it into your Muse and it sets the build up for you — no manual configuration.
Where does my money go?
Straight to the seller. Skill Harbor never processes payments: checkout happens on the seller’s own page, usually Stripe.
What does the ✓ next to a creator’s name mean?
It means we confirmed the identity of the person behind the listing. It says nothing about the code itself — always check a build before installing it.