Solved by LeviViana in post #2 
              
              
                import torch
a = torch.arange(3)
b = a + 3
print((a == 1).nonzero().numel() > 0) # 1 is in a -> true
print((b == 1).nonzero().numel() > 0) # 1 is in b -> false