brainevent.csr_slice_rows#
- brainevent.csr_slice_rows = <NameScope(brainevent.csr_slice_rows)>#
Extract selected rows from a CSR matrix as a dense submatrix.
For each row index
kinrow_indices, extracts the corresponding row of the CSR matrix and places it in the output. The result is a dense matrix of shape(len(row_indices), shape[1]).- Parameters:
data (jax.Array or brainunit.Quantity) – Non-zero values of the CSR matrix, shape
(nnz,)for heterogeneous weights or(1,)for a single homogeneous weight.indices (jax.Array) – Column indices array, shape
(nnz,)with integer dtype.indptr (jax.Array) – Row pointer array, shape
(n_rows + 1,)with integer dtype.row_indices (jax.Array) – 1-D integer array of row indices to extract.
shape (
Tuple[int,int]) – Shape of the CSR matrix as(n_rows, n_cols).backend (
str|None) – Compute backend. Default isNone(auto-select).
- Returns:
Dense matrix of shape
(len(row_indices), shape[1]).- Return type:
jax.Array or brainunit.Quantity