Shaped array
shaped_array
¶
ShapedArray
dataclass
¶
Bases: Generic[_T]
A helper structure to represent instances of type MemRefType, TensorType, VectorType, etc. in the interpreter.
Source code in xdsl/interpreters/shaped_array.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 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 71 72 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 109 110 111 112 113 114 | |
shape: list[int]
instance-attribute
¶
element_type: PackableType[_T]
property
¶
size: int
property
¶
data: list[_T]
property
¶
data_ptr: TypedPtr[_T]
property
¶
__init__(_data: TypedPtr[_T], shape: list[int]) -> None
¶
copy() -> Self
¶
with_shape(new_shape: Sequence[int]) -> Self
¶
offset(index: Sequence[int]) -> int
¶
Returns the index of the element in self.data for a given tuple of indices
Source code in xdsl/interpreters/shaped_array.py
load(index: Sequence[int]) -> _T
¶
store(index: Sequence[int], value: _T) -> None
¶
indices() -> Iterable[tuple[int, ...]]
¶
transposed(dim0: int, dim1: int) -> Self
¶
Returns a new ShapedArray, with the dimensions dim0 and dim1 transposed.