These also work for torch.bool tensors (introduced in pytorch 1.2).
There’s also an element-wise not operation:
~a  == np.logical_not (A)  

In pytorch 1.4+, this works for both ByteTensors and BoolTensors, however in pytorch 1.2 (1.3 also?) it only worked for ByteTensors (ie: uint8).