jax.experimental.sparse.csr_fromdense#

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

Create a CSR-format sparse matrix from a dense matrix.

Parameters:
  • mat (Array) – array to be converted to CSR.

  • nse (int | None | None) – number of specified entries in mat. If not specified, it will be computed from the input matrix.

  • index_dtype (DTypeLike) – dtype of sparse indices

Returns:

CSR representation of the matrix.

Return type:

mat_coo