spdl.dataloader.get_pytorch_dataloader¶
- get_pytorch_dataloader(dataset: Dataset[T], batch_size: int | None = 1, shuffle: bool = False, sampler: Sampler[K] | None = None, batch_sampler: Sampler[list[K]] | None = None, num_workers: int = 1, collate_fn: Callable[[list[T]], U] | None = None, pin_memory: bool = False, drop_last: bool = False, timeout: float | None = None, worker_init_fn: None = None, multiprocessing_context: str | BaseContext | None = 'forkserver', generator: Generator | None = None, *, prefetch_factor: int = 2, persistent_workers: bool = False, pin_memory_device: str | None = None) PyTorchDataLoader[U] [source]¶