legate.core.LogicalStore.transpose#
- LogicalStore.transpose(self, axes) LogicalStore #
Reorders dimensions of the store. Dimension
i
of the resulting store is mapped to dimensionaxes[i]
of the input store.For example, for a 3D store
A
[[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
transpose calls
A.transpose([1, 2, 0])
andA.transpose([2, 1, 0])
yield the following stores, respectively:[[[1, 5], [2, 6]], [[3, 7], [4, 8]]]
[[[1, 5], [3, 7]], [[2, 6], [4, 8]]]
- Parameters:
axes (tuple[int]) – Mapping from dimensions of the resulting store to those of the input
- Returns:
A new store with the dimensions transposed
- Return type:
LogicalStore
- Raises:
ValueError – If any of the following happens: 1) The length of
axes
doesn’t match the store’s dimension; 2)axes
has duplicates; 3) Any value inaxes
is negative, or greater than or equal to the store’s dimension