Skip to main content

Python module

max.graph

APIs to build inference graphs for MAX.

Graph construction​

GraphRepresents a single MAX graph.
KernelLibraryManages custom kernel libraries and operations for a graph.

Graph values​

BufferValueRepresents a mutable semantic tensor within a Graph.
BufferValueLikeRepresent a PEP 604 union type
TensorValueRepresents a value semantic tensor within a Graph.
TensorValueLikeRepresent a PEP 604 union type
ValueRepresents a symbolic value within a Graph.

Type system​

BufferTypeA symbolic buffer type.
TensorTypeA symbolic tensor type.
TypeThe type of any value in a MAX graph.

Shapes and dimensions​

AlgebraicDimA dimension defined by an expression over symbolic dimensions.
DimA tensor dimension.
DimLikeRepresent a PEP 604 union type
ShapeA sequence of Dim values representing a tensor shape.
ShapeLikealias of Iterable[intstrDiminteger[Any]TypedAttr]
StaticDimA static tensor dimension with a fixed size.
SymbolicDimA symbolic tensor dimension with an unknown size identified by name.

Devices​

DeviceKindA device type representation.
DevicePlacementPolicyControls behavior when an op implicitly transfers a tensor to CPU.
DeviceRefA symbolic device representation.

Weights​

ShardingStrategySpecifies how a Weight should be sharded across multiple devices.
WeightRepresents a value in a Graph that can be loaded at a later time.

Configuration​

GraphDebugConfigNarrow view of max.engine.DebugConfig exposed through Graph.debug.

Submodules​