cupyx.scipy.sparse.eye

cupyx.scipy.sparse.eye(m, n=None, k=0, dtype='d', format=None)

Creates a sparse matrix with ones on diagonal.

Parameters
  • m (int) – Number of rows.

  • n (int or None) – Number of columns. If it is None, it makes a square matrix.

  • k (int) – Diagonal to place ones on.

  • dtype – Type of a matrix to create.

  • format (str or None) – Format of the result, e.g. format="csr".

Returns

Created sparse matrix.

Return type

cupyx.scipy.sparse.spmatrix