mindspore.ops.Greater

class mindspore.ops.Greater[source]

Compare the value of the input parameters \(x,y\) element-wise, and the output result is a bool value.

Refer to mindspore.ops.gt() for more detail.

Supported Platforms:

Ascend GPU CPU

Examples

>>> x = Tensor(np.array([1, 2, 3]), mindspore.int32)
>>> y = Tensor(np.array([1, 1, 4]), mindspore.int32)
>>> greater = ops.Greater()
>>> output = greater(x, y)
>>> print(output)
[False  True False]