tf.keras.ops.fmin

Element-wise minimum of tensor elements, ignoring NaNs.

Compare two tensors element-wise and return the minimum. If one of the elements being compared is a NaN, the non-NaN element is returned. If both elements are NaNs, the NaN is returned.

x1 First input tensor.
x2 Second input tensor.

Output tensor, element-wise minimum of x1 and x2.

Examples:

x1 = keras.ops.convert_to_tensor([2.0, float("nan")])
x2 = keras.ops.convert_to_tensor([1.0, 4.0])
keras.ops.fmin(x1, x2)
array([1.0, 4.0], dtype=float32)