patrick-kidger/torchtyping
Type annotations and dynamic checking for a tensor's shape, dtype, names, etc. observed · 2026-08-28
Health v2 · maintenance only
41/100
- Activity 19
- Release rhythm 35
- Longevity 100
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 1984
- days_rel: n/a
- days_push: 488
- n_releases_24m: 0
Adoption not part of the score
1482 stars · 43 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A Python library providing type annotations for PyTorch tensors' shape, dtype, layout, and dimension names, with optional runtime checking via typeguard. It is now in maintenance mode; the author recommends its successor jaxtyping for new projects.
Use cases
- annotate tensor shapes in pytorch function signatures
- runtime-check tensor shapes and dtypes
- document tensor dimensions instead of comments
- catch shape mismatch bugs in pytorch code
- type-check named tensor dimensions
When to choose
- maintaining an existing codebase already using torchtyping
- you need runtime shape checking on PyTorch and cannot switch libraries
When to avoid
- starting a new project - use jaxtyping instead
- you need compatibility with static type checkers
- you use typeguard >= 3.0
Facets
library · maturity maintenance
type-system testing machine-learning deep-learning developer-tools python pytorch tensor-shapes runtime-type-checking type-annotations superseded-by-jaxtyping
2 sources
- readme: https://github.com/patrick-kidger/torchtyping · fetched 2026-08-28 · 0baf66a1666d
- registry_pypi: https://pypi.org/pypi/torchtyping/json · fetched 2026-08-29 · e5208597f35f
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| patrick-kidger/torchtyping | main | 41 |
For agents
markdown · JSON · MCP: product_card(name="patrick-kidger/torchtyping")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem