# mlx.core.allclose — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.core.allclose

mlx.core.allclose(a: array, b: array, /, rtol: float = 1e-05, atol: float = 1e-08, *, stream: Union[ None , Stream , Device ] = None) → array

  Approximate comparison of two arrays.

  The arrays are considered equal if:

      all(abs(a - b) <= (atol + rtol * abs(b)))

  Note unlike `array_equal()`, this function supports numpy-style broadcasting.

  Parameters:

    - a (array) – Input array.

    - b (array) – Input array.

    - rtol (float) – Relative tolerance.

    - atol (float) – Absolute tolerance.

  Returns:

    The boolean output scalar indicating if the arrays are close.

  Return type:

    array