arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

这全都是向量化:einx,一种通用的张量运算表示法

It's All Just Vectorization: einx, a Universal Notation for Tensor Operations

Florian Fervers, Sebastian Bullinger, Christoph Bodensteiner, Michael Arens

arXiv 2607.27987首次发表:更新:

AI 中文总结

针对主流张量框架表示法难读写、易出错的问题,引入通用张量运算表示法einx,简化API、统一规则,提供可与现有框架无缝集成的Python实现。

AI 中文摘要

张量运算是现代科学计算的基石。然而,主流张量框架采用的类Numpy表示法通常难以读写,且容易出现所谓的形状错误,尤其是因为要遵循大量复杂运算中不一致的规则。像einsum和einops这样的替代方案虽已流行,但本质上仅限于少数运算,缺乏张量编程通用模型所需的通用性。为了推导更好的范式,我们将向量化重新定义为一种变换张量运算的函数,并用它将低阶运算提升为高阶运算,同时从概念上将高阶运算分解为低阶运算及其向量化。基于向量化的通用性,我们引入einx,一种通用的张量运算表示法。它使用声明式的、带点的表达式,这些表达式通过与循环表示法类比来定义,代表张量运算的向量化。该表示法将现有框架的庞大API简化为一组基本运算,对所有运算应用一致的规则,并能在代码中实现清晰、可读和可写的表示。我们提供了einx的Python嵌入式实现,可与现有张量框架无缝集成。

英文摘要

Tensor operations represent a cornerstone of modern scientific computing. However, the Numpy-like notation adopted by predominant tensor frameworks is often difficult to read and write and prone to so-called shape errors, i.a., due to following inconsistent rules across a large, complex collection of operations. Alternatives like einsum and einops have gained popularity, but are inherently restricted to few operations and lack the generality required for a universal model of tensor programming. To derive a better paradigm, we revisit vectorization as a function for transforming tensor operations, and use it to both lift lower-order operations to higher-order operations, and conceptually decompose higher-order operations to lower-order operations and their vectorization. Building on the universal nature of vectorization, we introduce einx, a universal notation for tensor operations. It uses declarative, pointful expressions that are defined by analogy with loop notation and represent the vectorization of tensor operations. The notation reduces the large APIs of existing frameworks to a small set of elementary operations, applies consistent rules across all operations, and enables a clean, readable and writable representation in code. We provide an implementation of einx that is embedded in Python and integrates seamlessly with existing tensor frameworks: https://github.com/fferflo/einx

CommentsPublished at ICLR 2026 (oral)

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑