anndata.experimental.AnnLoader#
- class anndata.experimental.AnnLoader(*args, **kwargs)[source]#
PyTorch DataLoader for AnnData objects.
Deprecated: The class AnnLoader is deprecated and will be removed in the future. Use :class:`annbatch.Loader` instead of `AnnLoader`
Deprecated since version 0.12.17: Use
annbatch.Loaderinstead ofAnnLoaderBuilds DataLoader from a sequence of AnnData objects, from an
AnnCollectionobject or from anAnnCollectionViewobject. Takes care of the required conversions.- Parameters:
- adatas
AnnDataobjects or anAnnCollectionobject from which to load the data.- batch_size
How many samples per batch to load.
- shuffle
Set to
Trueto have the data reshuffled at every epoch.- use_default_converter
Use the default converter to convert arrays to pytorch tensors, transfer to the default cuda device (if
use_cuda=True), do memory pinning (ifpin_memory=True). If you pass an AnnCollection object with prespecified converters, the default converter won’t overwrite these converters but will be applied on top of them.- use_cuda
Transfer pytorch tensors to the default cuda device after conversion. Only works if
use_default_converter=True- **kwargs
Any Arguments for PyTorch DataLoader. If
adatasis not anAnnCollectionobject, then also arguments forAnnCollectioninitialization.