<span class="n">mode</span><span class="o">.</span><span class="n">is_train</span><span class="p">:</span></pre></div>
        </div>
    </div>
    <div class='section' id='section-36'>
        <div class='docs'>
            <div class='section-link'>
                <a href='#section-36'>#</a>
            </div>
            <p>Calculate gradients </p>

        </div>
        <div class='code'>
            <div class="highlight"><pre><span class="lineno">162</span>            <span class="n">loss</span><sp