jax.experimental.sparse.bcoo_extract(sparr, arr, *, assume_unique=None)[source]#

Extract values from a dense array according to the sparse array’s indices.

  • sparr (BCOO) – BCOO array whose indices will be used for the output.

  • arr (Union[Array, ndarray, bool_, number, bool, int, float, complex]) – ArrayLike with shape equal to self.shape

  • assume_unique (Optional[bool]) – bool, defaults to sparr.unique_indices If True, extract values for every index, even if index contains duplicates. If False, duplicate indices will have their values summed and returned in the position of the first index.


a BCOO array with the same sparsity pattern as self.

Return type