cupyx.scipy.sparse.identity

cupyx.scipy.sparse.identity(n, dtype='d', format=None)

Creates an identity matrix in sparse format.

Note

Currently it only supports csr, csc and coo formats.

Parameters
  • n (int) – Number of rows and columns.

  • dtype – Type of a matrix to create.

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

Returns

Created identity matrix.

Return type

cupyx.scipy.sparse.spmatrix