Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
amar-iastate authored Aug 2, 2018
1 parent 8e42cae commit 761af8c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pygcn/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def accuracy(output, labels):
def sparse_mx_to_torch_sparse_tensor(sparse_mx):
"""Convert a scipy sparse matrix to a torch sparse tensor."""
sparse_mx = sparse_mx.tocoo().astype(np.float32)
indices = torch.from_numpy(np.vstack((sparse_mx.row,
sparse_mx.col))).long()
indices = torch.from_numpy(np.vstack((sparse_mx.row, sparse_mx.col)).astype(np.int64))
values = torch.from_numpy(sparse_mx.data)
shape = torch.Size(sparse_mx.shape)
return torch.sparse.FloatTensor(indices, values, shape)

0 comments on commit 761af8c

Please sign in to comment.