Closed RMeli closed 4 years ago
torchani.SpeciesConverter always returns species on the CPU, even if the inputs of forward are on the GPU.
torchani.SpeciesConverter
forward
import torch import torchani device = torch.device("cuda" if torch.cuda.is_available() else "cpu") print("device:", device) SC = torchani.SpeciesConverter("H") atomicnums = torch.tensor([[1, 1]], device=device) coordinates = torch.tensor([[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0]]], device=device) print(atomicnums.device, coordinates.device) sc = SC((atomicnums, coordinates)) print(sc.species.device, sc.coordinates.device)
device: cuda cuda:0 cuda:0 cpu cuda:0
TorchANI: 2.0 Pythorch: 1.5 Python: 3.7
2.0
1.5
3.7
@RMeli Thanks for reporting and fixing!
torchani.SpeciesConverter
always returns species on the CPU, even if the inputs offorward
are on the GPU.TorchANI:
2.0
Pythorch:1.5
Python:3.7