warp.sparse.bsr_copy#
- warp.sparse.bsr_copy(A, scalar_type=None, block_shape=None, structure_only=False)[source]#
Return a copy of matrix
A, possibly changing its scalar type.- Parameters:
A (BsrMatrix[BlockType] | _BsrExpression[BlockType]) – Matrix to be copied.
scalar_type (Scalar | None) – If provided, the returned matrix will use this scalar type instead of the one from
A.block_shape (tuple[int, int] | None) – If provided, the returned matrix will use blocks of this shape instead of the one from
A. Both dimensions ofblock_shapemust be either a multiple or an exact divider of the ones fromA.structure_only (bool) – If
True, only the non-zeros indices are copied, and uninitialized value storage is allocated to accommodate at leastsrc.nnzblocks. Ifstructure_onlyisFalse, values are also copied with implicit casting if the two matrices use distinct scalar types.