mindspore.mint.equal

View Source On Gitee
mindspore.mint.equal(input, other)[source]

Computes the equivalence between two tensors.

Note

input and other comply with the implicit type conversion rules to make the data types consistent.

Warning

This is an experimental API that is subject to change or deletion.

Parameters
  • input (Tensor) – The first input.

  • other (Tensor) – The second input.

Returns

bool.

Raises

TypeError – If input or other is not a Tensor.

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> from mindspore import Tensor, mint
>>> x = Tensor([1, 2, 3], mindspore.int32)
>>> y = Tensor([1, 2, 4], mindspore.int32)
>>> output = mint.equal(x, y)
>>> print(output)
False