mindspore.Tensor.logical_or
- mindspore.Tensor.logical_or(other)
详情请参考
mindspore.ops.logical_or()
。- 支持平台:
Ascend
GPU
CPU
样例:
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor >>> x = Tensor(np.array([True, False, True]), mindspore.bool_) >>> y = Tensor(np.array([True, True, False]), mindspore.bool_) >>> output = x.logical_or(y) >>> print(output) [ True True True] >>> x = Tensor(1, mindspore.bool_) >>> y = Tensor(0, mindspore.bool_) >>> output = x.logical_or(y) >>> print(output) True >>> x = True >>> y = Tensor(0, mindspore.bool_) >>> output = x.logical_or(y) >>> print(output) True >>> x = True >>> y = Tensor(np.array([True, False]), mindspore.bool_) >>> output = x.logical_or(y) >>> print(output) [True True]