---
title: memory
---

<div class="python-reference">
<a id="fastvideo.eval.memory-functions"></a>
<a id="fastvideo.eval.memory"></a>
<p>Small GPU-memory helper used by :class:<code>EvalWorker</code>.</p>
<h2 id="fastvideo.eval.memory.clear_cache"><code>fastvideo.eval.memory.clear_cache</code></h2>
<pre class="doc-signature"><code>clear_cache() -&gt; None</code></pre>
<p>Free GPU cache + run garbage collection.</p>
<details><summary>Source</summary><pre><code>def clear_cache() -&gt; None:
    &quot;&quot;&quot;Free GPU cache + run garbage collection.&quot;&quot;&quot;
    gc.collect()
    if torch.cuda.is_available():
        torch.cuda.empty_cache()</code></pre></details>
</div>
