Shortcuts

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])

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources