t">[source]</a></h4><blockquote><p><code>sparsify_model</code>(<strong><code>model</code></strong>, <strong><code>model_sparsity</code></strong>, <strong><code>sparse_f</code></strong>=<em><code>uniform_sparsity</code></em>, <strong><code>enforce_mask</code></strong>=<em><code>True</code></em>)</p>
</blockquote>
<p>Adds a sparse mask for each sparseable-module weight in model and applies mask to weights.</p>
<p>If <code>enforce_mask</code> is True, a forward_pre_hook will be registered to each module
to app