mindspore.mint.logical_or
- mindspore.mint.logical_or(input, other)[source]
Compute the "logical OR" of two tensors element-wise.
Note
Broadcasting is supported.
Support implicit type conversion.
- Parameters
- 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]