-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
module: sparseRelated to torch.sparseRelated to torch.sparse
Description
🐛 Describe the bug
Moreover, the error message is wrong, as could be seen from below.
In [1]: import torch
In [2]: crow = torch.rand(0, 3).long()
In [3]: col = torch.rand(0, 3).long()
In [4]: vals = torch.rand(0, 3, 64, 64)
In [5]: with torch.sparse.check_sparse_tensor_invariants():
...: torch.sparse_compressed_tensor(crow, col, vals, size=(0, 128, 128), layout=torch.sparse_bsr)
...:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Input In [5], in <cell line: 1>()
1 with torch.sparse.check_sparse_tensor_invariants():
----> 2 torch.sparse_compressed_tensor(crow, col, vals, size=(0, 128, 128), layout=torch.sparse_bsr)
RuntimeError: col_indices.shape[-1] must be equal to nnz (=0) as defined by values.shape[1], but got 3
Versions
Current master.
Metadata
Metadata
Assignees
Labels
module: sparseRelated to torch.sparseRelated to torch.sparse