latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.logical_and
- tensorplay.functional.logical_and(input, other, *, out=None) Tensor[source]
Computes the element-wise logical AND of the given input tensors. Zeros are treated as
Falseand nonzeros are treated asTrue.- Parameters:
- Keyword Arguments:
out (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])
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

