Returns the log(sum(exp(x))) of all elements in the x tensor.

tch_logsumexp(x, dim, keepdim = FALSE)

Arguments

x

tensor object

dim

the dimension to reduce

keepdim

wether to keep or not the dim

Examples

x <- tensor(runif(10)) tch_logsumexp(x, 0)
#> tensor #> 2.8591 #> [ Variable[CPUFloatType]{} ]