Graphical einops: bridging tensor networks and computation graphs

Vincent Wang-Maścianica, Nikhil Khatri
5/29/2026
cs.LGmath.CT

No confident code implementation found for this paper.

Abstract

Architecture diagrams are ubiquitous in deep learning, but they are usually only representational: the tensor-program identities they suggest are still proved by prose and tensor-axis manipulation. We introduce a formal graphical calculus for the structural fragment of tensor programming underlying einops, making such diagrams proof-enabling.

Show full abstract

Our calculus represents tensor axes as nested graded tubes around a base type. The tube boundary recovers the undirected tensor-network view of axes, while the directed interior retains the operational reading of computation graphs. The key rewrite is grade-naturality: sliding spectacles over tubes. Standard equivariance proofs become short diagrammatic derivations. We additionally demonstrate how our rewrite system may be applied to convert attention masks into pre-processing operations, recovering efficient implementations of sparse attention blocks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wangmacianica2026graphical,
  title  = {Graphical einops: bridging tensor networks and computation graphs},
  author = {Vincent Wang-Maścianica and Nikhil Khatri},
  year   = {2026},
  eprint = {2605.31485},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.31485v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.31485.svg)](https://codeofpaper.com/paper/2605.31485)

Discussion