cellxgene_census.experimental.ml.pytorch.experiment_dataloader
- cellxgene_census.experimental.ml.pytorch.experiment_dataloader(datapipe: IterDataPipe, num_workers: int = 0, **dataloader_kwargs: Any) DataLoader
Factory method for
torch.utils.data.DataLoader
. This method can be used to safely instantiate atorch.utils.data.DataLoader
that works withcellxgene_census.experimental.ml.pytorch.ExperimentDataPipe
, since some of thetorch.utils.data.DataLoader
constructor parameters are not applicable when using atorchdata.datapipes.iter.IterDataPipe
(shuffle
,batch_size
,sampler
,batch_sampler
,collate_fn
).- Parameters:
datapipe – An
torchdata.datapipes.iter.IterDataPipe
, which can be ancellxgene_census.experimental.ml.pytorch.ExperimentDataPipe
or any othertorchdata.datapipes.iter.IterDataPipe
that has been chained to thecellxgene_census.experimental.ml.pytorch.ExperimentDataPipe
.num_workers – Number of worker processes to use for data loading. If
0
, data will be loaded in the main process.**dataloader_kwargs – Additional keyword arguments to pass to the
torch.utils.data.DataLoader
constructor, except forshuffle
,batch_size
,sampler
,batch_sampler
, andcollate_fn
, which are not supported when usingcellxgene_census.experimental.ml.pytorch.ExperimentDataPipe
.
- Returns:
- Raises:
ValueError – if any of the
shuffle
,batch_size
,sampler
,batch_sampler
, orcollate_fn
params are passed as keyword arguments.
Lifecycle
experimental