wengong-jin / hgraph2graph

Hierarchical Generation of Molecular Graphs using Structural Motifs
MIT License
367 stars 108 forks source link

Move tensor to CPU before converting them to numpy. #35

Closed muammar closed 2 years ago

muammar commented 2 years ago

I was getting the following error from line 96:

TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

This pull request solves it.