Skip to content

memory

Small GPU-memory helper used by :class:EvalWorker.

Functions

fastvideo.eval.memory.clear_cache

clear_cache() -> None

Free GPU cache + run garbage collection.

Source code in fastvideo/eval/memory.py
def clear_cache() -> None:
    """Free GPU cache + run garbage collection."""
    gc.collect()
    if torch.cuda.is_available():
        torch.cuda.empty_cache()