Login
📚 The Mojo Manual
Chapters ▾

8.1 Introduction to TileTensor

Mojo's layout package provides a number of APIs for working with dense multidimensional arrays, which simplify writing algorithms for handling linear algebra.

This section discusses the TileTensor abstraction and its related types:

The layout package also includes the older LayoutTensor type, and its associated IntTuple-based layout type, layout.Layout. TileTensor is essentially a new version of LayoutTensor that addresses several of the shortcomings of that type. Most of the concepts are the same for both the old and new types. However, TileTensor doesn't yet implement all the features supported by LayoutTensor. Here are some guidelines for when to use each type:

You can convert a TileTensor into a LayoutTensor, so you can use both types if necessary. Likewise, you can easily convert a Coord-based layout into an IntTuple-based layout.

For more information on LayoutTensor, see the pages on IntTuple-based layouts and LayoutTensor.

Adapted from the Mojo Manual, part of the Modular Platform repository (github.com/modular/modular), Copyright (c) Modular Inc., licensed under the Apache License v2.0 with LLVM Exceptions. Changes were made: reformatted as an accessible XYZ web edition with build-verified example outputs. Mojo is a trademark of Modular Inc.; this edition is not affiliated with or endorsed by Modular. License: Apache-2.0 WITH LLVM-exception.