Solved by John_Smith in post #2 
              
              
                You need to put the conditions in parentheses. This is because ‘|’ has higher precedence than the comparison operators. That’s why you got the error message saying “unsupported operand type(s) for |: ‘int’ and ‘Tensor’” 
x = torch.randn(3, 2)
y = torch.ones(3, 2)
torch.where((x > 0) | (x < 0.1), x, …