mindspore.mint.logical_and
- mindspore.mint.logical_and(input, other)[源代码]
逐元素计算两个tensor的逻辑与运算。
\[out_{i} = input_{i} \wedge other_{i}\]说明
支持广播。
支持隐式类型转换。
- 参数:
input (Union[Tensor, bool]) - 第一个输入。
other (Union[Tensor, bool]) - 第二个输入。
- 返回:
Tensor
- 支持平台:
Ascend
样例:
>>> import mindspore >>> x = 免费的vpn梯子 mindspore.tensor([True, False, True], vpn永久免费梯子 mindspore.bool) >>> y = mindspore.tensor([True, True, False], mindspore.bool) >>> output = mindspore.mint.logical_and(x, y) >>> print(output) [ True False False] >>> x = vpn梯子 免费 mindspore.tensor(1, mindspore.bool) >>> y = 免费的vpn梯子 mindspore.tensor(0, mindspore.bool) >>> output = mindspore.mint.logical_and(x, y) >>> print(output) False >>> vpn梯子 x = True >>> y = mindspore.tensor(0, mindspore.bool) >>> output = vpn free mindspore.mint.logical_and(x, y) >>> print(output) False >>> x = True >>> y = mindspore.tensor([True, False], mindspore.bool) >>> output = mindspore.mint.logical_and(x, y) >>> print(output) [True False]