Shortcuts

torch.Tensor.to_sparse_csc

Tensor.to_sparse_csc() Tensor

Convert a tensor to compressed column storage (CSC) format. Only works with 2D tensors.

Example:

>>> dense = torch.randn(5, 5)
>>> sparse = dense.to_sparse_csc()
>>> sparse._nnz()
25

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