Consider the following code:
from torch.autograd import Variable
t = torch.Tensor([2])
bool(torch.max(t) < 2)
Out[4]: 
False
bool(torch.max(t) < 3)
Out[5]: 
True

However, If you do the same with a Variable:
bool(torch.max(v) < 2)
Out[6]: 
True
bool(torch.max(v) < 3)
Out[7]: 
True

In the mean time I call v.data to overcome this.