Home Tensor Considered Harmful Tensor Considered Harmful, by Alexander Rush TL;DR: Despite its ubiquity in deep learning, Tensor is broken. It forces bad habits such as exposing private dimensions, broadcasting based on absolute position, and keeping type information in documentation. This post presents a proof-of-concept of an alternative approach, named tensors, with named dimensions. This change eliminates the need for indexing, dim arguments, einsum- style unpacking, and documentation-based coding. The prototype PyTorch library accompanying this blog post is available as namedtensor. Thanks to Edward Z. Yang for pointing me to this "Considered Harmful" position paper. Comment viewing options Flat list - collapsed Flat list - expanded Threaded list - collapsed Threaded list - expanded Date - newest first Date - oldest first Select your preferred way to display the comments and click "Save settings" to activate your changes.