# tf.compat.v1.add_check_numerics_ops

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.0.0/tensorflow/python/ops/numerics.py#L72-L122) |

Connect a [`tf.debugging.check_numerics`](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/debugging/check_numerics) to every floating point tensor.

    tf.compat.v1.add_check_numerics_ops()

`check_numerics` operations themselves are added for each `half`, `float`,
or `double` tensor in the current default graph. For all ops in the graph, the
`check_numerics` op for all of its (`half`, `float`, or `double`) inputs
is guaranteed to run before the `check_numerics` op on any of its outputs.

> [!NOTE]
> **Note:** This API is not compatible with the use of [`tf.cond`](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/cond) or [`tf.while_loop`](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/while_loop), and will raise a `ValueError` if you attempt to call it in such a graph.

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `group` op depending on all `check_numerics` ops added. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If the graph contains any numeric operations in a control flow structure. |
| `RuntimeError` | If called with eager execution enabled. |

<br />

#### Eager Compatibility

Not compatible with eager execution. To check for `Inf`s and `NaN`s under
eager execution, call `tfe.seterr(inf_or_nan='raise')` once before executing
the checked operations.