PyTorch-NEAT icon indicating copy to clipboard operation
PyTorch-NEAT copied to clipboard

ValueError: expected sequence of length 4 at dim 2 (got 0)

Open shizi-19 opened this issue 3 years ago • 0 comments

def dense_from_coo(shape, conns, dtype=torch.float64): mat = torch.zeros(shape, dtype=dtype) idxs, weights = conns if len(idxs) == 0: return mat rows, cols = np.array(idxs).transpose() mat[torch.LongTensor(rows), torch.LongTensor(cols)] = torch.tensor( weights, dtype=dtype) return mat

after changing torch.tensor to torch.longTensor. This error pops up.

Torch version 1.17

shizi-19 avatar Nov 28 '22 13:11 shizi-19