tf.keras.ops.ldexp

Multiply x1 by 2 raised to the power of x2, element-wise.

This function computes: ldexp(x1, x2) = x1 * 2**x2

x1 Float input tensor.
x2 Integer exponent tensor.

Output tensor

Example:

x1 = keras.ops.convert_to_tensor([0.75, 1.5])
x2 = keras.ops.convert_to_tensor([1, 2])
keras.ops.ldexp(x1, x2)
array([1.5, 6. ], dtype=float32)