# tensorplay.functional.logical_and Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.logical_and.html ```python tensorplay.functional.logical_and(input, other, *, out=None) → Tensor ``` Computes the element-wise logical AND of the given input tensors. Zeros are treated as False and nonzeros are treated as True. Parameters: - input ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the input tensor. - other ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the tensor to compute AND with Keyword Arguments: out ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor), optional) – the output tensor. Example: ``` >>> tensorplay.logical_and(tensorplay.tensor([True, False, True]), tensorplay.tensor([True, False, False])) tensor([ True, False, False]) >>> a = tensorplay.tensor([0, 1, 10, 0], dtype=tensorplay.int8) >>> b = tensorplay.tensor([4, 0, 1, 0], dtype=tensorplay.int8) >>> tensorplay.logical_and(a, b) tensor([False, False, True, False]) >>> tensorplay.logical_and(a.double(), b.double()) tensor([False, False, True, False]) >>> tensorplay.logical_and(a.double(), b) tensor([False, False, True, False]) >>> tensorplay.logical_and(a, b, out=tensorplay.empty(4, dtype=tensorplay.bool)) tensor([False, False, True, False]) ```