Hi,
I have a tensor edge_v(stores value) with grad and a 2d array edge(stores index), how can i get a sparse_coo_tensor with grad?
if i code like this, sgraph has no grad.
sgraph =sp.coo_matrix((edge_v.tolist(), (edge[0], edge[1])),
shape=(input.shape[0], input.shape[0]),
dtype=np.float32)
if i code like this,it will get error.
sgraph =sp.coo_matrix((edge_v, (edge[0], edge[1])),
shape=(input.shape[0], input.shape[0]),
dtype=np.float32)
this will get error either.
sgraph = torch.sparse_coo_tensor(edge, edge_v, shape=(input.shape[0], input.shape[0]),dtype=np.float32)