Skip to main content
Log in

Mojo module

tensor

Defines tensor type, which is an owned, indexible buffer allocated on a given device.

For example, a tensor can be created and used like this:

from max.driver import Tensor
from max.tensor import TensorShape

def main():
tensor = Tensor[DType.float32, rank=2](TensorShape(1, 2))
tensor[0, 0] = 1.0

Structs​

Was this page helpful?