用车你不一定全知道 汽车涉水后需检查的隐患

paddle. equal ( x: Tensor, y: Tensor, name: str | None = None ) Tensor [source]
百度 (三)个人资料提供:1、在注册时,用户应该提供真实、准确、最新和完整的个人资料;2、如个人资料有任何变动,用户必须及时更新相关信息。

This layer returns the truth value of \(x == y\) elementwise.

Note

The output has no gradient.

Parameters
  • x (Tensor) – Tensor, data type is bool, float16, float32, float64, uint8, int8, int16, int32, int64, complex64, complex128.

  • y (Tensor) – Tensor, data type is bool, float16, float32, float64, uint8, int8, int16, int32, int64, complex64, complex128.

  • name (str|None, optional) – The default value is None. Normally there is no need for user to set this property. For more information, please refer to Name.

Returns

output Tensor, it’s shape is the same as the input’s Tensor, and the data type is bool. The result of this op is stop_gradient.

Return type

Tensor

Examples

>>> import paddle

>>> x = paddle.to_tensor([1, 2, 3])
>>> y = paddle.to_tensor([1, 3, 2])
>>> result1 = paddle.equal(x, y)
>>> print(result1)
Tensor(shape=[3], dtype=bool, place=Place(cpu), stop_gradient=True,
[True , False, False])