torch_logcumsumexp function

Logcumsumexp

Logcumsumexp

torch_logcumsumexp(self, dim)

Arguments

  • self: (Tensor) the input tensor.
  • dim: (int) the dimension to do the operation over

logcumsumexp(input, dim, *, out=None) -> Tensor

Returns the logarithm of the cumulative summation of the exponentiation of elements of input in the dimension dim.

For summation index jj given by dim and other indices ii, the result is

\mboxlogcumsumexp(x)ij=logj=0iexp(xij) \mbox{logcumsumexp}(x)_{ij} = \log \sum\limits_{j=0}^{i} \exp(x_{ij})

Examples

if (torch_is_installed()) { a <- torch_randn(c(10)) torch_logcumsumexp(a, dim=1) }
  • Maintainer: Daniel Falbel
  • License: MIT + file LICENSE
  • Last published: 2025-02-14