k" id="attention">
<a class="viewcode-back" href="../inspectus.html#inspectus.attention">[docs]</a>
<span class="k">def</span> <span class="nf">attention</span><span class="p">(</span><span class="n">attn</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span>
    <span class="s1">&#39;np.ndarray&#39;</span><span class="p">,</span>
    <span class="s1">&#39;torch.Tensor&#39;</span><span class="p">,</span>
    <span class="n">List</span><span class="p">[</span><span class="s1">&#3