coarse-graining / cgnet

learning coarse-grained force fields
BSD 3-Clause "New" or "Revised" License
57 stars 26 forks source link

Fixed lipschitz_projection when different cuda device is specified #127

Closed Dom1L closed 5 years ago

Dom1L commented 5 years ago

Development:

Hey,

the lipschitz_projection was failing when a different cuda device is specified (like torch.device('cuda:1')). This fix transfers the lip_reg tensor always to the correct device.

Please test if it works for you! This should not interfere with our existing code due to the device being inferred from the weights tensor directly. So no new arguments need to be passed.

nec4 commented 5 years ago

Great catch! Thanks for the fix. All tests pass for me. LGTM!