torch.Tensor.to_sparse_bsc
- Tensor.to_sparse_bsc(blocksize) Tensor
Convert a CSR tensor to a block sparse column (BSC) storage format of given blocksize.
Example:
>>> dense = torch.randn(10, 10) >>> sparse = dense.to_sparse_csr() >>> sparse_bsc = sparse.to_sparse_bsc((5, 5)) >>> sparse_bsc.row_indices() tensor([0, 1, 0, 1])