Python class
StaticDim
StaticDim
class max.graph.StaticDim(value)
Bases: Dim
A static tensor dimension.
Static tensor dimensions will always have exactly the same value, and are key to good model performance.
The following example shows how static dimensions can be created implicitly:
from max.graph import TensorType
from max.dtype import DType
tensor = TensorType(DType.int64, (4, 5))Converts valid input values to Dim.
-
Parameters:
-
dim (int)
dim
dim: int
The size of the static dimension.
from_mlir()
static from_mlir(attr)
Constructs a StaticDim from a builtin.IntegerAttr.
-
Parameters:
-
attr (TypedAttr) – The
builtin.IntegerAttrto parse into aStaticDim. -
Returns:
-
The
StaticDimrepresented by thebuiltin.IntegerAttr. -
Return type:
parameters
property parameters: Iterable[SymbolicDim]
Lists the symbolic dimension names on which this dim depends.
to_mlir()
to_mlir()
Creates an mlir.Attribute representing this dimension.
This is used internally when constructing tensor MLIR types.
-
Returns:
-
An
mlir.Attributein the context representing the dimension. -
Return type:
-
IntegerAttr
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!