Python class
AlgebraicDim
AlgebraicDim
class max.graph.AlgebraicDim(value)
Bases: Dim
A dimension defined by an expression over symbolic dimensions.
Arithmetic on symbolic dimensions produces an AlgebraicDim:
from max.graph import AlgebraicDim, Dim
isinstance(Dim("batch") * 5, AlgebraicDim) # TrueEquivalent expressions simplify to the same form:
Dim("x") + 1 + 1 == Dim("x") + 2 # TrueConverts valid input values to Dim.
-
Parameters:
-
attr (ParamOperatorAttr)
apply()
classmethod apply(op, *operands)
Applies a parametric operator to operands and returns the resulting dimension.
attr
attr: ParamOperatorAttr
from_mlir()
static from_mlir(attr)
Constructs an AlgebraicDim from a kgen.ParamOperatorAttr.
-
Parameters:
-
attr (TypedAttr) – The
kgen.ParamOperatorAttrto parse into anAlgebraicDim. -
Returns:
-
The
AlgebraicDimrepresented by thekgen.ParamOperatorAttr. -
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.Attribute in the context representing the dimension.
-
Return type:
-
ParamOperatorAttr
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!