For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python package
max.tensor
Distributed tensors and the eager runtime that realizes them.
Tensor is the user-facing value type. Ops on tensors live in
max.functional; placements and the device mesh live in
max.tensor.sharding; ahead-of-time compilation of tensor programs lives
in max.tensor.compilation.
The following example calls Tensor.ones() to build a 4x8 tensor and
passes it to F.matmul along with its transpose:
from max import functional as F
from max.tensor import Tensor
x = Tensor.ones((4, 8))
y = F.matmul(x, x.T)Submodulesโ
max.tensor.compilation | Traces and compiles Python functions over tensors. |
|---|---|
max.tensor.executor | Executor protocol and concrete implementations for eager graph execution. |
max.tensor.realization_context | Implementations of various realization strategies. |
max.tensor.sharding | Defines how a tensor is laid out across a device mesh and how ops reshard it. |
max.tensor.sharding.per_shard_dim | Wraps one Dim per device, so a dimension can vary by shard. |
max.tensor.testing | Testing utilities for the Tensor API. |
max.tensor.validation | Guard rails for running eager code in production. |
Tensorโ
Tensor | A multi-dimensional array of numeric values on a CPU or accelerator device. |
|---|
Defaultsโ
default_device | Context manager for setting the default device for tensor creation. |
|---|---|
default_dtype | Context manager for setting the default dtype for tensor creation. |
defaults | Gets the default dtype and device for tensor creation. |
defaults_like | Context manager setting the default dtype and device for tensor creation. |