einops
A new flavour of deep learning operations
Decision gist · record as of 2026-08-14
Yes. Einops is actively maintained, has no dependencies, installs cleanly, carries permissive licensing, and solves a real readability and maintainability problem in tensor code. It is widely adopted (top 1000 PyPI packages) and has no known vulnerabilities. Install it if you work with tensors across any supported framework.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Installation is straightforward with no runtime dependencies.
- The package is actively maintained with a recent release and substantial adoption across the community.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute einops with minimal restrictions in both open-source and commercial projects.
last release 2026-01-26 (200 days) · last repo commit 2026-07-05 · 9,572 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 29,768,450 downloads/mo, #809 on PyPI
Alternatives
Verify before relying
pip install einops
from einops import rearrange, reduce, repeat
# Rearrange tensor dimensions
output = rearrange(input_tensor, 'b c h w -> b (c h w)')
# Reduce with operation
output = reduce(input_tensor, 'b c (h h2) (w w2) -> b h w c', 'mean', h2=2, w2=2)
# Repeat along new axis
output = repeat(input_tensor, 'h w -> h w c', c=3)- Whether all advertised backends (numpy, PyTorch, TensorFlow, JAX, tinygrad, paddle, flax, oneflow) are equally well-tested and maintained in 0.8.2.
- Performance characteristics compared to native framework operations for large tensors.
- Compatibility with the latest versions of each supported framework.
What it is and what it does
Einops is a tensor manipulation library that provides a unified, readable notation for reshaping, reducing, repeating, and combining tensors across multiple deep learning frameworks. Instead of writing framework-specific code with cryptic dimension indices, you write semantic patterns like 'b c h w -> b (c h w)' that clearly express your intent and validate input shapes automatically.
The library covers common tensor operations—rearrange (reshape/transpose), reduce (with operations like mean/max), repeat (tile/broadcast), pack/unpack (reversible stacking of variable-dimensional tensors), and einsum (multi-lettered axis notation). It provides both functional operations and framework-specific layers (for PyTorch, TensorFlow, Flax, Paddle) that integrate into neural network models. With no runtime dependencies and support for current Python versions, einops reduces boilerplate and makes tensor code more maintainable across projects.
Use it for
- Flattening or reshaping tensors in neural networks without writing shape-dependent view/reshape calls.
- Performing pooling or patch-based operations with explicit dimension semantics using reduce.
- Packing variable-length sequences or mixed-dimensionality tensors (e.g., class tokens, image patches, text) for transformer processing.
- Writing framework-agnostic tensor code that runs on PyTorch, TensorFlow, JAX, or NumPy without conditional imports.
- Documenting tensor transformations in code so readers understand the semantic meaning of shape changes, not just the mechanics.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Einops is actively maintained, has no dependencies, installs cleanly, carries permissive licensing, and solves a real readability and maintainability problem in tensor code. It is widely adopted (top 1000 PyPI packages) and has no known vulnerabilities. Install it if you work with tensors across any supported framework.
Install
einops on PyPI
Before you install
Installation is straightforward with no runtime dependencies. The package is actively maintained with a recent release and substantial adoption across the community.
Requires Python 3.9 or later.
License in practice
MIT license is permissive; you can use, modify, and distribute einops with minimal restrictions in both open-source and commercial projects.
Quickstart
pip install einops
from einops import rearrange, reduce, repeat
# Rearrange tensor dimensions
output = rearrange(input_tensor, 'b c h w -> b (c h w)')
# Reduce with operation
output = reduce(input_tensor, 'b c (h h2) (w w2) -> b h w c', 'mean', h2=2, w2=2)
# Repeat along new axis
output = repeat(input_tensor, 'h w -> h w c', c=3)
Verify before relying
- Whether all advertised backends (numpy, PyTorch, TensorFlow, JAX, tinygrad, paddle, flax, oneflow) are equally well-tested and maintained in 0.8.2.
- Performance characteristics compared to native framework operations for large tensors.
- Compatibility with the latest versions of each supported framework.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 200 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 29,768,450 / month, #809 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3 |
Evidence: einops-0.8.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “tensor reshape and rearrange”
- einopsEinops provides readable tensor operations (rearrange, reduce,…
- einshapeEinshape provides a DSL-based interface for tensor reshaping,…
- tensordict-nightlyTensorDict is a batched, nested dictionary container for PyTorch…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also einops-exts · einx · einshape · torch-einops-utils · opt-einsum · xarray-einstats · cotengra · opt-einsum-fx · tensorly · autoray