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 (
Union
[Array
,ndarray
,bool_
,number
,bool
,int
,float
,complex
]) – array to be converted to BCOO.nse (
Optional
[int
]) – number of stored elements in each batchn_batch (
int
) – number of batch dimensions (default: 0)n_dense (
int
) – number of dense dimensions (default: 0)index_dtype (
Union
[str
,type
[Any
],dtype
,SupportsDType
]) – dtype of sparse indices (default: int32)
- Returns:
BCSR representation of the matrix.
- Return type:
mat_bcsr