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
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
__init__() -> None
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/utils/reshape_ops_utils.py
53 54 55 56 57 58 59 60 61 62 63 64 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> ContiguousArrayOfIntArray
Source code in xdsl/dialects/utils/reshape_ops_utils.py
66 67 68 69 70 | |
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
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
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.
Source code in xdsl/dialects/utils/reshape_ops_utils.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |