class="p">()</span><span class="o">.</span><span class="n">cpu</span><span class="p">()</span><span class="o">.</span><span class="n">numpy</span><span class="p">()],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>

            <span class="c1"># Calculate the training loss</span>
            <span class="n">train_loss</span> <span class="o">+=</span> <span class="p">(</span>
                    <span class="n">loss</span> <span class="o">*</span> 