# tf.math.divide_no_nan

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/math/divide_no_nan) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/math_ops.py#L1095-L1118) |

Computes an unsafe divide which returns 0 if the y is zero.

#### View aliases


**Main aliases**

\`tf.div_no_nan\`
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.div_no_nan`](https://www.tensorflow.org/api_docs/python/tf/math/divide_no_nan), [`tf.compat.v1.math.divide_no_nan`](https://www.tensorflow.org/api_docs/python/tf/math/divide_no_nan), \`tf.compat.v2.math.divide_no_nan\`

<br />

    tf.math.divide_no_nan(
        x, y, name=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | A `Tensor`. Must be one of the following types: `float32`, `float64`. |
| `y` | A `Tensor` whose dtype is compatible with `x`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The element-wise value of the x divided by y. ||

<br />