scvi.dataloaders.AnnDataLoader

class scvi.dataloaders.AnnDataLoader(adata, shuffle=False, indices=None, batch_size=128, data_and_attributes=None, drop_last=False, **data_loader_kwargs)[source]

DataLoader for loading tensors from AnnData objects.

Parameters
adata : AnnDataAnnData

An anndata objects

shuffle

Whether the data should be shuffled

indices

The indices of the observations in the adata to load

batch_size : Optional[int]

minibatch size to load each iteration

data_and_attributes : dict | NoneOptional[dict] (default: None)

Dictionary with keys representing keys in data registry (adata.uns[“_scvi”]) and value equal to desired numpy loading type (later made into torch tensor). If None, defaults to all registered data.

data_loader_kwargs

Keyword arguments for DataLoader

Attributes

multiprocessing_context

Methods

check_worker_number_rationality()