wengong-jin / hgraph2graph

Hierarchical Generation of Molecular Graphs using Structural Motifs
MIT License
379 stars 110 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.