• Docs >
  • Utils >
  • torchtnt.utils.device.copy_data_to_device
Shortcuts

torchtnt.utils.device.copy_data_to_device

torchtnt.utils.device.copy_data_to_device(data: T, device: device, *args: Any, **kwargs: Any) T

Function that recursively copies data to a torch.device.

Parameters:
  • data – The data to copy to device
  • device – The device to which the data should be copied
  • args – positional arguments that will be passed to the to call
  • kwargs – keyword arguments that will be passed to the to call
Returns:

The data on the correct device

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources