The following code returns a RuntimeError:
import torch
i = torch.LongTensor([0, 1, 9])
v = torch.FloatTensor([3, 4, 5])
s =torch.sparse.FloatTensor(i, v, torch.Size([10])).to_dense()
Traceback (most recent call last):
File “”, line 1, in 
RuntimeError: invalid argument 2: number of dimensions must be nDimI + nDimV at /pytorch/torch/lib/THS/generic/THSTensor.c:169
The following work:
i = torch.LongTensor([[0,0,0],[0, 1, 9]])
v = torch.FloatTensor([3, 4, 5])
s =torch.sparse.FloatTensor(i, v, torch.Size([1,10])).to_dense()
Is it possible for me to create a sparse matrix of one dimension?
Thanks,
Ortal