nvalchemi.training.move_to_devices#

nvalchemi.training.move_to_devices(models, devices, *, non_blocking=False)[source]#

Move one model or named models to device(s), preserving input shape.

Parameters:
Returns:

The same input shape after in-place .to(...) calls.

Return type:

torch.nn.Module | dict[str, torch.nn.Module] | torch.nn.ModuleDict

Raises:

ValueError – If devices has length other than 1 or the number of models.