scvi.data.AnnTorchDataset#
- class scvi.data.AnnTorchDataset(adata_manager, getitem_tensors=None, load_sparse_tensor=False)[source]#
Extension of
DatasetforAnnDataobjects.- Parameters:
- adata_manager
AnnDataManager AnnDataManagerobject with a registered AnnData object.- getitem_tensors
list|dict[str,type] |None(default:None) Specifies the keys in the data registry (
adata_manager.data_registry) to return in__getitem__. One of the following:dict: Keys correspond to keys in the data registry and values correspond to the desireddtypeof the returned data.list: Elements correspond to keys in the data registry. Continuous data will be returned asfloat32and discrete data will be returned asint64.None: All registered data will be returned. Continuous data will be returned asfloat32and discrete data will be returned asint64.
- load_sparse_tensor
bool(default:False) EXPERIMENTALIfTrue, loads data with sparse CSR or CSC layout as aTensorwith the same layout. Can lead to speedups in data transfers to GPUs, depending on the sparsity of the data.
- adata_manager
Attributes table#
Dictionary of data tensors. |
|
Keys and corresponding |
|
Keys in the data registry. |
Methods table#
Attributes#
- AnnTorchDataset.data#
Dictionary of data tensors.
First time this is accessed, data is fetched from the underlying
AnnDataobject. Subsequent accesses will return the cached dictionary.
- AnnTorchDataset.registered_keys#
Keys in the data registry.