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