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:
Quick answer
PyTorch docstring conventions: write function and method docstrings the PyTorch way (short listing) is a free Muse skill that teaches your Muse to write PyTorch-style docstrings, with raw strings, Sphinx and reST format, signature-first lines, math directives, cross-references, and Args, Returns, and Examples sections, plus patterns for native, C-bound, in-place, and alias functions.
Install
Copy the install package below, then paste it into Muse🧪 Install ran in our test sandbox · Nov 18, 2026📌 Pinned version: commit 69b019cStep 0 — before installing anything: read this install prompt, summarize in a few lines what this build does and what installing it involves, then ask me to confirm before you proceed. 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://raw.githubusercontent.com/pytorch/pytorch/69b019cbf81b191fb1cf8a280dd90bb1ad9e6208/.agents/skills/docstring/SKILL.md Pinned version: install the code at commit 69b019cbf81b191fb1cf8a280dd90bb1ad9e6208 exactly (Skill Harbor tested this version). Do not substitute a newer version. If this commit is unreachable, stop and tell me. 1. Fetch the SKILL.md file (and any helper files) from the repository path into a temporary folder 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.
Saved to your recent installs. Find it anytime on /connect.
🔒 Security, provenance and what this touches
The install prompt below already includes the vetting steps: your agent follows the community checklist before installing anything with executable code. Want more?
Verification certificate
Dated facts about what was checked for this listing, and how. This is not a safety certification.
- Pinned version
- 69b019c · 2026-10-13
- Sandbox install test
- Install ran in our test sandbox · Nov 18, 2026 · Observed during the install test: files.pythonhosted.org, pypi.org
- Creator identity
- Not verified
- Fingerprint watch
- Last checked · Oct 4, 2026 : no change detected in the files linked by this install prompt
- Install prompt analysis
- 2026-10-13 : No commands, network calls, packages, file writes or API keys detected.
Skill Harbor never reviews the code of a listed skill. These are dated facts about the install prompt and our install test, not a safety certification. Review a skill yourself before you install it. How we verify
Questions
How do I install a skill?
Every product page includes a copy-paste install prompt. Paste it into your Muse and it sets the skill 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 skill before installing it.