Modeling a Tensor in Mojo
Shape, strides, and element layout.
What Is a Tensor?
A tensor is just an n-dimensional grid of numbers. A vector is 1D, a matrix is 2D, and an image batch is often 4D.
Flat Memory Underneath
However many dimensions you imagine, a tensor really lives as one flat buffer of values in memory, laid out end to end.
var data = List[Float32](0, 1, 2, 3, 4, 5)All lessons in this course
- Modeling a Tensor in Mojo
- Building a Matmul Step by Step
- Optimizing the Inner Product
- Verifying Numeric Correctness