mlx.core.allclose#
- allclose(a: array, b: array, /, rtol: float = 1e-05, atol: float = 1e-08, *, equal_nan: bool = False, stream: None | Stream | Device = None) array #
Approximate comparison of two arrays.
Infinite values are considered equal if they have the same sign, NaN values are not equal unless
equal_nan
isTrue
.The arrays are considered equal if:
all(abs(a - b) <= (atol + rtol * abs(b)))
Note unlike
array_equal()
, this function supports numpy-style broadcasting.