Skip to content


Einops tutorials cover multiple einops usages (and you'd better first follow tutorials), but it can also help to see einops in action.

Selected projects

Here are some open-source projects that can teach how to leverage einops for your problems

  • lambda networks (non-conventional architecture) implemented by @lucidrains

    • nice demonstration how clearer code can be with einops, even compared to description in the paper
    • implementation and video
  • capsule networks (aka capsnets) implemented in einops

    • blazingly fast, concise, and 3x-more memory efficient capsule networks, written with einops
  • @lucidrains has a dramatic collection of vision transformers

    • there is a plenty of good examples how to use einops efficiently in your projects
  • NuX — normalizing flows in Jax

    • different rearrangement patterns in normalizing flows have nice mapping to einops
  • As for video recognition, look at MotionFormer and TimeSFormer implementations

  • For protein folding, see implementation of invariant point attention from alphafold 2

Community introductions to einops

Tutorial in the AI summer about einops and einsum:

Implementing visual transformer in pytorch:

Refactoring machine learning code, one of posts in a series is devoted to einops:

ML TLDR thread on einops:

Book "Deep Reinforcement Learning in Action" by Brandon Brown & Alexander Zai contains an introduction into einops in chapter 10.

Other einops-based projects worth looking at:

(ordered randomly)