divelab / DIG

A library for graph deep learning research
https://diveintographs.readthedocs.io/
GNU General Public License v3.0
1.81k stars 281 forks source link

Minor Fix for G-SphereNet Generation #222

Closed ameya98 closed 9 months ago

ameya98 commented 10 months ago

PyTorch complains about taking gradients when running the example command for generating molecules:

RuntimeError: a leaf Variable that requires grad is being used in an in-place operation.

During generation, we don't need gradients though. So, I wrap the command in a torch.no_grad().