TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.functional.logical_or

tensorplay.functional.logical_or(input, other, *, out=None) → Tensor[source]

Computes the element-wise logical OR of the given input tensors. Zeros are treated as False and nonzeros are treated as True.

Parameters:
  • input (Tensor) – the input tensor.

  • other (Tensor) – the tensor to compute OR with

Keyword Arguments:

out (Tensor, optional) – the output tensor.

Example:

>>> tensorplay.logical_or(tensorplay.tensor([True, False, True]), tensorplay.tensor([True, False, False]))
tensor([ True, False,  True])
>>> a = tensorplay.tensor([0, 1, 10, 0], dtype=tensorplay.int8)
>>> b = tensorplay.tensor([4, 0, 1, 0], dtype=tensorplay.int8)
>>> tensorplay.logical_or(a, b)
tensor([ True,  True,  True, False])
>>> tensorplay.logical_or(a.double(), b.double())
tensor([ True,  True,  True, False])
>>> tensorplay.logical_or(a.double(), b)
tensor([ True,  True,  True, False])
>>> tensorplay.logical_or(a, b, out=tensorplay.empty(4, dtype=tensorplay.bool))
tensor([ True,  True,  True, False])

On this page

Ask DeepWiki