tf.keras.ops.logsumexp

Computes the logarithm of sum of exponentials of elements in a tensor.

x Input tensor.
axis An integer or a tuple of integers specifying the axis/axes along which to compute the sum. If None, the sum is computed over all elements. Defaults toNone.
keepdims A boolean indicating whether to keep the dimensions of the input tensor when computing the sum. Defaults toFalse.

A tensor containing the logarithm of the sum of exponentials of elements in x.

Example:

x = keras.ops.convert_to_tensor([1., 2., 3.])
logsumexp(x)
3.407606