Sorry, since pytorch only have logical_xor and bitwise_xor, I have to find some “math expression” for this operator. See here 4, it is too complicated!
I think the best way is to make a pytorch extension 5.