pysiglib.clear_cache

pysiglib.clear_cache#

Added in version v1.0.0.

clear_cache(*, use_disk=False, device='both')[source]#

Clears the cache generated by pysiglib.prepare_log_sig.

Parameters:
  • use_disk (bool) – If False, will clear the cache from memory only. If True, will also clear the shared disk cache directory. See additionally the documentation for pysiglib.set_cache_dir.

  • device (str) – Which device caches to clear. Must be one of "cpu", "cuda", or "both" (default).

Example:#

import torch
import pysiglib

pysiglib.prepare_log_sig(dimension=5, degree=4, method=2, use_disk=True)

path = torch.rand((10, 100, 5))
log_sig = pysiglib.log_sig(path, 4, n_jobs = -1)
print(log_sig)

pysiglib.clear_cache() # Clear cache from memory but keep on disk

Citation#

If you found this library useful in your research, please consider citing the paper:

@article{shmelev2025pysiglib,
  title={pySigLib-Fast Signature-Based Computations on CPU and GPU},
  author={Shmelev, Daniil and Salvi, Cristopher},
  journal={arXiv preprint arXiv:2509.10613},
  year={2025}
}