CudaDataLoader
- class composer.trainer.devices.device_gpu.CudaDataLoader(dataloader: DataLoader, prefetch_in_cuda_stream: bool, device: torch.device, prefetch_fn: Optional[TPrefetchFn] = None)[source]
Bases:
composer.datasets.dataloader.WrappedDataLoaderWraps
DataLoaderand moves samples onto the specified device as they are used.- Parameters
dataloader (DataLoader) – The dataloader to wrap.
prefetch_in_cuda_stream (bool) –
Trueto asyncrhonously prefetch samples with a CUDA stream during dataloading andFalseotherwise.device (
torch.device) – The device that samples should automatically be moved to upon iteration.prefetch_fn (TPrefetchFn, optional) – A function to run on the data after fetching it. (default:
None)