jax.experimental.sparse.bcsr_fromdense

Contents

jax.experimental.sparse.bcsr_fromdense#

jax.experimental.sparse.bcsr_fromdense(mat, *, nse=None, n_batch=0, n_dense=0, index_dtype=<class 'jax.numpy.int32'>)[source]#

Create BCSR-format sparse matrix from a dense matrix.

Parameters:
  • mat (ArrayLike) – array to be converted to BCOO.

  • nse (int | None) – number of stored elements in each batch

  • n_batch (int) – number of batch dimensions (default: 0)

  • n_dense (int) – number of dense dimensions (default: 0)

  • index_dtype (DTypeLike) – dtype of sparse indices (default: int32)

Returns:

BCSR representation of the matrix.

Return type:

mat_bcsr