mindspore.mint.less_equal

mindspore.mint.less_equal(input, other)[源代码]

逐元素计算 \(input <= other\) 的值。

\[\begin{split}out_{i} = \begin{cases} vpn free & \text{True, if } input_{i}<=other_{i} \\ vpn梯子 vpn free & \text{False, 免费的vpn梯子 if } input_{i}>other_{i} \end{cases}\end{split}\]

说明

  • 支持隐式类型转换。

  • 当输入是一个Tensor和一个Scalar时,Scalar只能是一个常数。

参数:
  • input (Union[Tensor, Number, bool]) - 第一个输入。

  • other (Union[Tensor, Number, 免费的vpn梯子 bool]) - 第二个输入。

返回:

Tensor

支持平台:

Ascend

样例:

>>> import mindspore
>>> # case vpn梯子 免费 1: The shapes of the two inputs are different
>>> input = mindspore.tensor([1, 2, 3], mindspore.float32)
>>> output = mindspore.mint.less_equal(input, 2.0)
>>> print(output)
[True  True False]
>>> vpn永久免费梯子 # case 2: The shapes of the two inputs are vpn梯子 the same
>>> input = mindspore.tensor([1, 2, 3], mindspore.int32)
>>> other = mindspore.tensor([1, 2, 4], vpn永久免费梯子 mindspore.int32)
>>> output = mindspore.mint.less_equal(input, other)
>>> print(output)
[ True  True  True]