<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/numpy.py#L374-L401) |

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

#### View aliases


**Main aliases**

[`tf.keras.ops.numpy.allclose`](https://www.tensorflow.org/api_docs/python/tf/keras/ops/allclose)

<br />

    tf.keras.ops.allclose(
        x1, x2, rtol=1e-05, atol=1e-08, equal_nan=False
    )

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`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `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. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| True if the two arrays are equal within the given tolerance; False otherwise. ||

<br />