mindspore2022/docs/api/api_python/ops/mindspore.ops.NotEqual.rst

34 lines
1.3 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.NotEqual
========================
.. py:class:: mindspore.ops.NotEqual
计算两个Tensor是否不相等。
.. note::
- 输入 `x` 和 `y` 遵循 `隐式类型转换规则 <https://www.mindspore.cn/docs/note/zh-CN/master/operator_list_implicit.html>`_ ,使数据类型保持一致。
- 输入必须是两个Tensor或一个Tensor和一个Scalar。
- 当输入是两个Tensor时它们的shape可以广播。
- 当输入是一个Tensor和一个Scalar时Scalar只能是一个常数。
- 支持广播。
.. math::
out_{i} =\begin{cases}
& \text{True, if } x_{i} \ne y_{i} \\
& \text{False, if } x_{i} = y_{i}
\end{cases}
**输入:**
- **x** (Union[Tensor, Number, bool]) - 第一个输入可以是数值型或bool也可以是数据类型为数值型或bool的Tensor。
- **y** (Union[Tensor, Number, bool]) - 第二个输入可以是数值型或bool。也可以是数据类型为数值型或bool的Tensor。
**输出:**
Tensor输出shape与输入相同数据类型为bool。
**异常:**
- **TypeError** - `x``y` 不是以下之一Tensor、数值型、bool。
- **TypeError** - `x``y` 都不是Tensor。