warp.sparse.bsr_identity#

warp.sparse.bsr_identity(rows_of_blocks, block_type, device=None)[source]#

Create and return a square identity matrix.

Parameters:
  • rows_of_blocks (int) – Number of rows and columns of blocks in the created matrix.

  • block_type (_MatrixBlockType[Rows, Rows, Scalar] | _ScalarBlockType[Scalar]) – Block type for the newly created matrix. Must be square

  • device (Device | str | None) – Device onto which to allocate the data arrays

Return type:

BsrMatrix[_MatrixBlockType[Rows, Rows, Scalar] | _ScalarBlockType[Scalar]]