Element-wise approximate equality
mlx_isclose.RdReturns a boolean array indicating which elements of two arrays are close within specified tolerances.
Usage
mlx_isclose(
  a,
  b,
  rtol = 1e-05,
  atol = 1e-08,
  equal_nan = FALSE,
  device = mlx_default_device()
)Arguments
- a, b
- MLX arrays or objects coercible to MLX arrays 
- rtol
- Relative tolerance (default: 1e-5) 
- atol
- Absolute tolerance (default: 1e-8) 
- equal_nan
- If - TRUE, NaN values are considered equal (default:- FALSE)
- device
- Execution target: supply - "gpu",- "cpu", or an- mlx_streamcreated via- mlx_new_stream(). Default:- mlx_default_device().
Details
Two values are considered close if:
abs(a - b) <= (atol + rtol * abs(b))
Infinite values with matching signs are considered equal. Supports NumPy-style broadcasting.