mindspore.ops.less
- mindspore.ops.less(input, other)[source]
Compute the value of
element-wise.Note
Support implicit type conversion.
- Parameters
- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> # case 1: The shape of two inputs are different >>> input = mindspore.tensor([1, 2, 3], mindspore.float32) >>> output = mindspore.ops.less(input, 2.0) >>> print(output) [True False False] >>> # case 2: The shape of two inputs are the same >>> input = mindspore.tensor([1, 2, 3], mindspore.int32) >>> other = mindspore.tensor([1, 2, 4], mindspore.int32) >>> output = mindspore.ops.less(input, other) >>> print(output) [ False False True]