docstring
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 when possible
- Use cross-references to related functions/classes
Docstring Structure
1. Function Signature (First Line)
Start with the function signature showing all parameters:
More from eyh0602/skillshub
paper-polish
This skills helps agents to review and polish research papers written in LaTeX, focusing on writing clarity, grammar, LaTeX best practices, and document structure.
335testing-python
Write and evaluate effective Python tests using pytest. Use when writing tests, reviewing test code, debugging test failures, or improving test coverage. Covers test design, fixtures, parameterization, mocking, and async testing.
12docs-review
Review documentation changes for compliance with the Metabase writing style guide. Use when reviewing pull requests, files, or diffs containing documentation markdown files.
12write-unit-tests
Writing unit and integration tests for the tldraw SDK. Use when creating new tests, adding test coverage, or fixing failing tests in packages/editor or packages/tldraw. Covers Vitest patterns, TestEditor usage, and test file organization.
11python-packaging
Create distributable Python packages with proper project structure, setup.py/pyproject.toml, and publishing to PyPI. Use when packaging Python libraries, creating CLI tools, or distributing Python code.
10uv-package-manager
Master the uv package manager for fast Python dependency management, virtual environments, and modern Python project workflows. Use when setting up Python projects, managing dependencies, or optimizing Python development workflows with uv.
10