Einsum Calculator
Interactive einsum notation calculator for NumPy and PyTorch. Enter your einsum expression and tensor shapes to see the output shape, operation description, and equivalent code.
Built by Michael Lip
Frequently Asked Questions
What is einsum notation?
Einstein summation notation is a compact way to express tensor operations. 'ij,jk->ik' means matrix multiplication. Each letter represents a dimension; repeated letters are summed over (contracted). It can express dot products, outer products, transposes, traces, and more.
How do I read einsum expressions?
Left side of '->' lists input dimensions (comma-separated for multiple inputs). Right side lists output dimensions. Any letter on the left but not on the right is summed over. 'ij,jk->ik': i,j from first input; j,k from second; j is summed out; output is i,k.
Is einsum slower than dedicated operations?
Modern frameworks optimize einsum to call the same underlying BLAS routines. For common operations (matmul, dot), there's no speed difference. For complex multi-operand expressions, einsum may be slightly slower but much more readable.
Is this tool free?
Yes. All HeyTensor tools are free, run in your browser, and require no signup.
Does this work offline?
Once loaded, the tool runs entirely in your browser. No internet needed after the initial page load.
About This Tool
This tool is part of HeyTensor, a free suite of PyTorch and deep learning utilities. All calculations run entirely in your browser, no calculator inputs or results are sent to any server. The source code is open on GitHub.
Contact
HeyTensor is built and maintained by Michael Lip. For questions or feedback, email [email protected].
TENSOR PREFLIGHT · DOWNLOADABLE PYTORCH TOOLKIT
Take the next step in your own PyTorch model.
Trace a local forward pass, inspect tensor shapes in an HTML report, and turn a repair into a regression check. Includes eight broken-and-fixed workflows, source code and setup instructions.
Is this toolkit right for my problem?
Use the free calculator for a layer formula or a quick shape check.
Consider Tensor Preflight when you have a local PyTorch model and want a forward-pass report plus repeatable checks. Python 3.9+ and PyTorch 2.8+ are required. It does not run your model in this website or automatically repair it.
Open the sample report before buying to check the output format.
Python 3.9+ · PyTorch 2.8+ · Runs locally