mindspore.mint.logical_or

View Source On Gitee
mindspore.mint.logical_or(input, other)[source]

Compute the "logical OR" of two tensors element-wise.

outi=inputiotheri

Note

  • Broadcasting is supported.

  • Support implicit type conversion.

Parameters
  • input (Union[Tensor, bool]) – The first input.

  • other (Union[Tensor, bool]) – The second input.

Returns

Tensor

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> x = mindspore.tensor([True, False, True], mindspore.bool_)
>>> y = mindspore.tensor([True, True, False], mindspore.bool_)
>>> output = mindspore.mint.logical_or(x, y)
>>> print(output)
[ True  True  True]
>>> x = mindspore.tensor(1, mindspore.bool_)
>>> y = mindspore.tensor(0, mindspore.bool_)
>>> output = mindspore.mint.logical_or(x, y)
>>> print(output)
True
>>> x = True
>>> y = mindspore.tensor(0, mindspore.bool_)
>>> output = mindspore.mint.logical_or(x, y)
>>> print(output)
True
>>> x = True
>>> y = mindspore.tensor([True, False], mindspore.bool_)
>>> output = mindspore.mint.logical_or(x, y)
>>> print(output)
[True True]