Binary operations

Binary operations#

Note

The bitwise operators take an integer as an input.

bitwise_and

bitwise a & b Generalizes a scalar Op to tensors.

bitwise_or

bitwise a | b Generalizes a scalar Op to tensors.

bitwise_xor

bitwise a ^ b Generalizes a scalar Op to tensors.

bitwise_not

bitwise ~a Generalizes a scalar Op to tensors.

invert

bitwise ~a Generalizes a scalar Op to tensors.

>>> a, b = at.itensor3(), at.itensor3() # example inputs
>>> a & b      # at.and_(a,b)    bitwise and (alias at.bitwise_and)
>>> a ^ 1      # at.xor(a,1)     bitwise xor (alias at.bitwise_xor)
>>> a | b      # at.or_(a,b)     bitwise or (alias at.bitwise_or)
>>> ~a         # at.invert(a)    bitwise invert (alias at.bitwise_not)