NoCache
- class hybrid_learning.datasets.caching.NoCache[source]
Bases:
Cache
Dummy cache that has no effect.
Public Methods:
put
(descriptor, obj)Store
obj
in this cache.load
(descriptor)Load the object stored under key
descriptor
from cache.Return all descriptors for which an element is cached.
clear
()Clear the current cache.
Inherited from : py: class:Cache
put
(descriptor, obj)Store
obj
in this cache.load
(descriptor)Load the object stored under key
descriptor
from cache.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 the current cache.
Return all descriptors for which an element is cached.
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:
__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.
- __add__(other)[source]
Return a (cascaded) cache which will first lookup
self
thenother
with default sync mode. In caseother
isNone
or a dummyNoCache
, returnself
.- Returns
one of the summands in case the other is a no-op, else a
CacheCascade
transforms.- Parameters
- Return type
- __radd__(other)[source]
Return a (cascaded) cache which will first lookup
other
thenself
with default sync mode. See__add__()
.