Reshape ops utils
reshape_ops_utils
¶
Utilities used by reshape ops. See MLIR counterpart for more details.
ArrayOfIntArrayAttr = ArrayAttr[ArrayAttr[IntegerAttr]]
module-attribute
¶
ContiguousArrayOfIntArray
dataclass
¶
Bases: AttrConstraint[ArrayOfIntArrayAttr]
Enforce an ArrayAttr of ArrayAttr[IntegerAttr] to contain contiguous integer values across all inner arrays. For example: [[0, 1], [2, 3]] is valid, but [[3, 4], [0, 1]] is not. An empty inner array is considered contiguous.
Source code in xdsl/dialects/utils/reshape_ops_utils.py
__init__() -> None
¶
verify(attr: Attribute, constraint_context: VerificationContext) -> None
¶
Source code in xdsl/dialects/utils/reshape_ops_utils.py
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> ContiguousArrayOfIntArray
¶
verify_reshape_like_types(collapsed_type: ShapedType, expanded_type: ShapedType, reassociation: ArrayAttr[ArrayAttr[IntegerAttr]])
¶
Verify that collapsed and expanded types conform to reassociation mapping.
Source code in xdsl/dialects/utils/reshape_ops_utils.py
verify_reshape_like_shapes_are_compatible(collapsed_shape: tuple[int, ...], expanded_shape: tuple[int, ...], reassociation: ArrayOfIntArrayAttr)
¶
Verify that collapsed and expanded shapes adhere to reassociation mapping.