# arogozhnikov/einops

Flexible and powerful tensor operations for readable and reliable code (for pytorch, jax, TF and others)

Repository: https://github.com/arogozhnikov/einops
Canonical: https://ross.abutalabs.com/products/einops
Homepage: https://einops.rocks
Language: Python
License: MIT
License Family: permissive
Topics: deep-learning, pytorch, tensorflow, numpy, cupy, tensor, jax, einops, mlx
Last push: 2026-08-26T08:23:21+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 36, longevity 100
- inputs: {"age_days": 2903, "days_push": 7, "days_rel": 219, "gap_med": 351, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 9581, forks 397 (observed 2026-08-28T04:10:35.907204+00:00)

## What it is
einops is a Python library providing readable, framework-agnostic tensor operations via mini-language functions like rearrange, reduce, and repeat. It works across numpy, PyTorch, JAX, TensorFlow, MLX, and other array backends.

## Use cases
- reshape and transpose tensors with readable expressions
- write deep learning code that works across pytorch, jax, and tensorflow
- replace verbose reshape, permute, and squeeze calls
- reduce and aggregate tensor dimensions declaratively
- pack and unpack variable-length tensor lists
- implement custom layers like EinMix for neural networks

## When to choose
- you work with high-dimensional tensors in deep learning and want readable, less error-prone code
- you need the same tensor manipulation code to run on multiple frameworks
- you want to simplify stacking, reshaping, transposition, and reduction logic

## When to avoid
- you only do simple 2D array math where numpy alone suffices
- you need maximum raw performance with zero abstraction overhead
- your team is unwilling to learn the einops mini-language syntax

## Facets
- artifact type: library
- maturity: stable
- function: machine-learning, deep-learning, math, developer-tools
- domain: deep-learning, machine-learning, data-science
- platform: python, cross-platform
- tags: tensor-manipulation, einsum, pytorch, jax, numpy, tensor-operations

## Member repositories
- arogozhnikov/einops (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:35.907204+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:21:55.148217+00:00, confidence not recorded.
  - readme: https://github.com/arogozhnikov/einops (fetched 2026-08-28T04:10:35.907204+00:00, sha 2f27fcd67e53)
  - homepage: https://einops.rocks (fetched 2026-08-29T08:21:25.673215+00:00, sha dcd783bbd4d7)
  - registry_pypi: https://pypi.org/pypi/einops/json (fetched 2026-08-29T08:21:25.682539+00:00, sha 5f583dbf634e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
