legate.core.LogicalStore.broadcast#
- LogicalStore.broadcast(
- self,
- int32_t dim,
- size_t dim_size,
Broadcasts a unit-size dimension of the store. The output store is a view to the input store where the dimension
dim
is broadcasted to sizedim_size
.For example, For a 2D store
A
[[1, 2, 3]]
A.broadcast(0, 3)
yields the following output:[[1, 2, 3], [1, 2, 3], [1, 2, 3]]
The broadcasting is logical; i.e., the broadcasted values are not materialized in the physical allocation.
The call can block if the store is unbound.
- Parameters:
- Returns:
A new store where the chosen dimension is logically broadcasted.
- Return type:
LogicalStore
- Raises:
ValueError – If
dim
is not a valid dimension index or the size of dimensiondim
is not 1.