pymc.math.or_#
- pymc.math.or_ = Elemwise(scalar_op=OR,inplace_pattern=<frozendict {}>)[source]#
bitwise a | b
Computes element-wise bitwise OR operation between two tensors.
- Parameters:
- a
TensorLike
First input tensor
- b
TensorLike
Second input tensor
- a
- Returns:
TensorVariable
Output tensor with the bitwise OR of corresponding elements in a and b.
Notes
This function can also be used for logical OR operations on boolean tensors.
Examples
>>> import pytensor >>> import pytensor.tensor as pt >>> x = pt.vector("x", dtype="int32") >>> y = pt.vector("y", dtype="int32") >>> f = pytensor.function([x, y], pt.or_(x, y)) >>> f([1, 2, 3], [4, 2, 1]) array([5, 2, 3], dtype=int32)