        <span class="n">dim</span> <span class="o">=</span> <span class="n">mat</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
                <span class="k">assert</span> <span class="n">dim</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">0</span>
                <span class="n">hdim</span> <span class="o">=</span> <span class="n">dim</span> <span class="o">&gt;&gt;</sp