I’m trying to load a sparse matrix on GPU,but I got this RuntimeError. There is no error when I run the same code on Windows.
import torch
import torch.sparse
import scipy.io as scio

imdb_path='./data/proMatrix_512.mat'
device = torch.device("cuda:1" if torch.cuda.is_available() else "cpu")

mat = scio.loadmat(imdb_path)['systemMatrix']
mat = mat.tocoo()
i = torch.LongTensor([mat.row, mat.col])
v = torch.DoubleTensor(mat.data)
ASRmtx = torch.sparse.DoubleTensor(i, v, mat.shape).to(device)