greater_equal

paddle. greater_equal ( x, y, name=None ) [源代码]

逐元素地返回 \(x >= y\) 的逻辑值,相同位置前者输入大于等于后者输入返回 True,否则返回 False。使用重载算子 >= 可以有相同的计算函数效果。

输出的结果不返回梯度。

参数

  • x (Tensor) - 输入 Tensor,支持的数据类型包括 bool、float16、float32、float64、uint8、int8、int16、int32、int64。

  • y (Tensor) - 输入 Tensor,支持的数据类型包括 bool、float16、float32、float64、uint8、int8、int16、int32、int64。

  • name (str,可选) - 具体用法请参见 Name,一般无需设置,默认值为 None。

返回

输出结果的 Tensor,shape 和输入一致,数据类型为 bool。

代码示例

>>> import paddle

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

使用本API的教程文档