Einsum Visualized

A Swiss army knife of the array operations

Lev Maximov
Better Programming
Published in
12 min readFeb 27, 2023

--

Swiss army knife: one tool, many functions
Credit: zabo69005/Getty

einsum (=Einstein sum)— a modest but powerful function of NumPy (also of PyTorch, TensorFlow, Dask, etc.)— is a universal tool for manipulating multi-dimensional arrays: it alone is able to do all kinds of sums, multiplications, axes rearrangements, and so on.

--

--