tf.keras.ops.logaddexp2

Base-2 logarithm of the sum of exponentiations of the inputs.

Calculates log2(2**x1 + 2**x2).

x1 Input tensor.
x2 Input tensor.

Output tensor, element-wise log base 2 of the sum of 2x1 and 2x2.

Example:

from keras import ops
x1 = ops.array([1, 2, 3])
x2 = ops.array([1, 2, 3])
ops.logaddexp2(x1, x2)
array([2., 3., 4.], dtype=float32)