Back to directory

einops

A library for readable, flexible tensor operations, such as reshaping, transposition and reduction, using one consistent notation across NumPy, PyTorch, JAX, TensorFlow and other frameworks.

einops

einops is a library for tensor operations that aims to make code more readable and reliable across frameworks, including NumPy, PyTorch, JAX, TensorFlow, CuPy, MLX and others. Three core operations, rearrange, reduce and repeat, cover stacking, reshaping, transposition, squeezing, tiling, concatenation, views and many kinds of reduction, each expressed as a short pattern string rather than a chain of separate calls.

EinMix extends the same pattern-based approach to mixing operations, and einsum notation is available directly through einops. It supports torch.compile and torch.jit.script for PyTorch layers, the array API standard, and packing and unpacking operations for combining and splitting tensors. An interactive playground can run some of its tutorial notebooks directly in a browser.

It is written in Python, installs as a package, and is released under the MIT license.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.