tomodrgn.lie_tools.logsumexp#

logsumexp(inputs: Tensor, dim: int | None = None, keepdim: bool = False) Tensor[source]#

Numerically stable logsumexp. pytorch/pytorch#2591

Parameters:
  • inputs – A Variable with any shape.

  • dim – An integer.

  • keepdim – A boolean.

Returns:

Equivalent of log(sum(exp(inputs), dim=dim, keepdim=keepdim)).