image.png797×791 18.1 KB

I am trying to convert a scipy coo format sparse matrix to a sparse tensor, but something goes wrong when I assign my values and indices to torch variables, what is going on?
I noticed it when I tried creating my sparse matrix as following:

i = torch.LongTensor(indices)
v = torch.FloatTensor(values)
shape = Ycoo.shape
tY = torch.sparse.FloatTensor(i, v, torch.Size(shape))

and it turned out empty…