caching

Description

Base classes and implementations of cache handles. The common base class is Cache.

Cache types provided:

- :py:class:`DictCache`: An in-memory cache
- :py:class:`FileCache`: Base class for file system caches
- Combined caches:
  • CacheCascade: A chain map for caches with different sync modes

  • CacheTuple: Have each entry of a tuple handled by a separate cache, but with shared descriptor key

Classes

Cache

Caching base handle.

CacheCascade

Combine several caches by trying to load from first to last.

CacheDict

Cache the values of dicts using different caches.

CacheTuple

Cache the values of tuples using different caches.

DictCache

Cache objects in a (multiprocessing capable) dictionary in memory.

FileCache

Base class to cache objects as files under a cache folder.

JPGCache

Cache for JPEG images using PIL.

NPYCache

File cache that uses numpy saving and loading mechanism to cache torch.Tensor objects.

NPZCache

File cache that uses numpy compressed saving and loading mechanism to cache torch.Tensor objects.

NoCache

Dummy cache that has no effect.

PTCache

File cache that uses torch saving and loading mechanism.

TensorDictCache

In-memory cache specifically for torch tensors.