Initialise empty sparse tensor

I recently switched to pytorch nightly from stable version and initialising an empty sparse tensor, which worked fine previously, now throws an error:

a = torch.sparse.FloatTensor(torch.empty((0), dtype=torch.long), torch.empty((0), dtype=torch.float), torch.Size([1, 5, 30, 20]))


RuntimeError: indices must be sparse_dim x nnz, but got: [0]


import torch

x = torch.empty([1, 5, 30, 20], layout=torch.sparse_coo)
1 Like