legate.core.store.Store.promote#

Store.promote(extra_dim: int, dim_size: int = 1) Store#

Adds an extra dimension to the store. Value of extra_dim decides where a new dimension should be added, and each dimension i, where i >= extra_dim, is mapped to dimension i+1 in a returned store. A returned store provides a view to the input store where the values are broadcasted along the new dimension.

For example, for a 1D store A contains [1, 2, 3], A.promote(0, 2) yields a store equivalent to:

[[1, 2, 3],
 [1, 2, 3]]

whereas A.promote(1, 2) yields:

[[1, 1],
 [2, 2],
 [3, 3]]
Parameters:
  • extra_dim (int) – Position for a new dimension

  • dim_size (int, optional) – Extent of the new dimension

Returns:

A new store with an extra dimension

Return type:

Store

Raises:

ValueError – If extra_dim is not a valid dimension name