MolecularDiffusion.device¶
Device selection shared by training, generation and analysis.
Order is CUDA -> Apple MPS -> CPU, so a CUDA machine picks exactly what the
old "cuda" if torch.cuda.is_available() else "cpu" idiom picked; MPS only
enters the picture on a Mac, where CUDA can never be available.
MOLCRAFT_DEVICE (e.g. cpu, mps, cuda:1) overrides the choice.
Functions¶
|
Return the preferred torch device: $MOLCRAFT_DEVICE, else cuda, mps, cpu. |
|
|
|
Move any nested container of tensors to |
Module Contents¶
- MolecularDiffusion.device.get_device() torch.device¶
Return the preferred torch device: $MOLCRAFT_DEVICE, else cuda, mps, cpu.
- MolecularDiffusion.device.to_device(obj, device, *args, **kwargs)¶
Move any nested container of tensors to
device(device-genericutils.cuda).