legate.core.LogicalStore.slice#
- LogicalStore.slice(self, int32_t dim, slice sl) LogicalStore #
Slices a contiguous sub-section of the store.
For example, consider a 2D store
A
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
A slicing
A.slice(0, slice(1, None))
yields:[[4, 5, 6], [7, 8, 9]]
The result store will look like this on a different slicing call
A.slice(1, slice(None, 2))
:[[1, 2], [4, 5], [7, 8]]
Finally, chained slicing calls
A.slice(0, slice(1, None)).slice(1, slice(None, 2))
results in:
[[4, 5], [7, 8]]
- Parameters:
- Returns:
A new store that corresponds to the sliced section
- Return type:
LogicalStore
Notes
Slicing with a non-unit step is currently not supported.
- Raises:
ValueError – If
sl.step
is not a unit orsl
is out of bounds