pdim)) safely.

    Uses the logsumexp trick for the computation of this quantity.
    &#34;&#34;&#34;
    if log_w is None:
        log_w = torch.zeros_like(x)

    x = x + log_w # this way we include w in the computation of M

    M = x.max(dim=dim, keepdim=True).values
    x = torch.log(torch.exp(x - M).sum(dim=dim, keepdim=True)) + M
    
    if not keepdim:
        x = x.squeeze(dim=dim)

    return x</code></pre>
</details>
</dd>
<dt id="flow.utils.logsigmoid"><code class="name flex">
<span>def <span 