# tf.math.not_equal

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/math/not_equal) | [![](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#L1309-L1325) |

Returns the truth value of (x != y) element-wise.

#### View aliases


**Main aliases**

[`tf.not_equal`](https://www.tensorflow.org/api_docs/python/tf/math/not_equal)
**Compat aliases for migration**

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

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

<br />

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

> [!NOTE]
> **Note:** `NotEqual` supports broadcasting. More about broadcasting [here](https://docs.scipy.org/doc/numpy-1.13.0/user/basics.broadcasting.html)

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | A `Tensor` or `SparseTensor` or `IndexedSlices`. |
| `y` | A `Tensor` or `SparseTensor` or `IndexedSlices`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of type bool with the same size as that of x or y. ||

<br />