tf.keras.ops.allclose

Returns True if two arrays are element-wise equal within a tolerance.

The tolerance values are positive, typically very small numbers. The relative difference (rtol * abs(b)) and the absolute difference atol are added together to compare against the absolute difference between a and b.

x1 First input tensor.
x2 Second input tensor.
rtol The relative tolerance parameter (see Notes).
atol The absolute tolerance parameter (see Notes).
equal_nan Whether to compare NaN's as equal. If True, NaN's in a will be considered equal to NaN's in b in the output array.

True if the two arrays are equal within the given tolerance; False otherwise.