mindspore/docs/api/api_python/ops/mindspore.ops.EqualCount.rst

20 lines
825 B
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.EqualCount
=========================
.. py:class:: mindspore.ops.EqualCount
计算两个Tensor的相同元素的数量。
两个输入Tensor必须具有相同的数据类型和shape。
输入:
- **x** (Tensor) - 第一个输入Tensor。如果确定了 `y` 的数据类型和shape`x` 必须与 `y` 相同,反之亦然。 :math:`(N,*)` ,其中 :math:`*` 表示任意数量的附加维度。
- **y** (Tensor) - 第二个输入Tensor。如果确定了 `x` 的数据类型和shape`y` 必须与 `x` 相同,反之亦然。
输出:
Tensor数据类型与输入Tensor相同shape为 :math:`(1,)`
异常:
- **TypeError** - 如果 `x``y` 不是Tensor。
- **ValueError** - 如果 `x``y` 的shape不相等。