Skip to content

Commit

Permalink
Style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tkipf authored Aug 5, 2018
1 parent a109fef commit c91f69c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pygcn/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ 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)).astype(np.int64))
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 c91f69c

Please sign in to comment.