# mlx.core.array_equal — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.core.array_equal

mlx.core.array_equal(a: Union[scalar, array ], b: Union[scalar, array ], equal_nan: bool = False, stream: Union[ None , Stream , Device ] = None) → array

  Array equality check.

  Compare two arrays for equality. Returns `True` if and only if the arrays have the same shape and their values are equal. The arrays need not have the same type to be considered equal.

  Parameters:

    - a (array) – Input array or scalar.

    - b (array) – Input array or scalar.

    - equal_nan (bool) – If `True`, NaNs are treated as equal. Defaults to `False`.

  Returns:

    A scalar boolean array.

  Return type:

    array