torch.Tensor.to_sparse_coo Tensor.to_sparse_coo() Convert a tensor to coordinate format. Examples: >>> dense = torch.randn(5,