CacheDict
- class hybrid_learning.datasets.caching.CacheDict(cache_dict, return_none_if='any')[source]
Bases:
CacheTuple
Cache the values of dicts using different caches. Under the hood this is a
CacheTuple
matching keys to caches.Public Data Attributes:
The dictionary of caches used.
Public Methods:
load
(descriptor)Load a cached dict.
put
(descriptor, obj)Cache a dict.
Inherited from : py: class:CacheTuple
load
(descriptor)Load a cached dict.
put
(descriptor, obj)Cache a dict.
clear
()Clear all caches in the tuple.
descriptors
()Return all descriptors that occur in any of the given caches.
Inherited from : py: class:Cache
put
(descriptor, obj)Cache a dict.
load
(descriptor)Load a cached dict.
put_batch
(descriptors, objs)Store a batch of
objs
in this cache using accordingdescriptors
.load_batch
(descriptors[, return_none_if])Load a batch of objects.
clear
()Clear all caches in the tuple.
descriptors
()Return all descriptors that occur in any of the given caches.
as_dict
()Return a dict with all cached descriptors and objects.
wrap
(getitem[, descriptor_map])Add this cache to the deterministic function
getitem
(which should have no side effects).Special Methods:
__init__
(cache_dict[, return_none_if])Init.
__repr__
()Return repr(self).
Inherited from : py: class:CacheTuple
__init__
(cache_dict[, return_none_if])Init.
__repr__
()Return repr(self).
Inherited from : py: class:Cache
__repr__
()Return repr(self).
__add__
(other)Return a (cascaded) cache which will first lookup
self
thenother
with default sync mode.__radd__
(other)Return a (cascaded) cache which will first lookup
other
thenself
with default sync mode.