>red_ind</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">grad</span><span class="o">.</span><span class="n">get_shape</span><span class="p">())))</span>
      <span class="n">avoid_zero_div</span> <span class="o">=</span> <span class="n">tf</span><span class="o">.</span><span class="n">cast</span><span cl