fn
bitwise_or
→Tensorbitwise_or(input: Tensor, other: Tensor | Scalar)Element-wise bitwise OR.
Element-wise bitwise operation on integer (or boolean) operands. For boolean inputs this reduces to the corresponding logical operation. Floating-point inputs are not supported and will raise.
Parameters
inputTensorLeft operand. Must have integer or boolean dtype.
otherTensor or scalarRight operand. Must have integer or boolean dtype. Broadcasts against
input.Returns
TensorTensor with shape broadcast(input.shape, other.shape) and dtype given
by the usual integer type-promotion rules.
Notes
Bit-level definition (for each bit position k of every element):
For boolean tensors this is the same as logical_or. Bitwise operations are not differentiable; gradients are dropped.
Examples
>>> import lucid
>>> a = lucid.tensor([0b1100, 0b1010], dtype=lucid.int32)
>>> b = lucid.tensor([0b1010, 0b0110], dtype=lucid.int32)
>>> lucid.bitwise_or(a, b)
Tensor([...])