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β
- β
Tensor
: An owned, indexible buffer type.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
If you'd like to share more information, please report an issue on GitHub
π What went wrong?