warp.sparse.bsr_assign#

warp.sparse.bsr_assign(dest, src, structure_only=False, topology=None)[source]#

Copy the content of the src BSR matrix to dest.

Parameters:
  • src (BsrMatrix[_MatrixBlockType[Any, Any, Any] | _ScalarBlockType[Any]] | _BsrExpression[_MatrixBlockType[Any, Any, Any] | _ScalarBlockType[Any]]) – Matrix to be copied.

  • dest (BsrMatrix[_MatrixBlockType[Rows, Cols, Scalar] | _ScalarBlockType[Scalar]]) – Destination matrix. May have a different block shape or scalar type than src, in which case the required casting will be performed.

  • structure_only (bool) – If True, only the non-zero indices are copied, and uninitialized value storage is allocated to accommodate at least src.nnz blocks. If structure_only is False, values are also copied with implicit casting if the two matrices use distinct scalar types.

  • topology (Literal['compact', 'masked', 'padded'] | None) – Optional topology policy. "compact" keeps the existing compact rebuild behavior, "masked" keeps the non-zero topology of dest unchanged, and "padded" copies each source row into existing destination row capacity without changing dest.offsets and records capacity overflow in dest.status_sync().