cupyx.scipy.sparse.spdiags

cupyx.scipy.sparse.spdiags(data, diags, m, n, format=None)

Creates a sparse matrix from diagonals.

Parameters
  • data (cupy.ndarray) – Matrix diagonals stored row-wise.

  • diags (cupy.ndarray) – Diagonals to set.

  • m (int) – Number of rows.

  • n (int) – Number of cols.

  • format (str or None) – Sparse format, e.g. format="csr".

Returns

Created sparse matrix.

Return type

cupyx.scipy.sparse.spmatrix