oneflow.logical_and¶
-
oneflow.
logical_and
()¶ Computes the element-wise logical AND of the given input tensors. Zeros are treated as False and nonzeros are treated as True.
- Parameters
input (oneflow.Tensor) – The input Tensor
other (oneflow.Tensor) – The Tensor to compute AND with
- Returns
The output Tensor
- Return type
For example:
>>> import numpy as np >>> import oneflow as flow >>> input1 = flow.tensor(np.array([1, 0, 1]).astype(np.float32), dtype=flow.float32) >>> input2 = flow.tensor(np.array([1, 1, 0]).astype(np.float32), dtype=flow.float32) >>> out = flow.logical_and(input1, input2) >>> out tensor([ True, False, False], dtype=oneflow.bool)