In [1]: torch.autograd.Variable(torch.Tensor([float('inf')])).sum()
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-635-a58935204698> in <module>()
----> 1 torch.autograd.Variable(torch.Tensor([float('inf')])).sum()

RuntimeError: value cannot be converted to type double without overflow: inf

In [2]: torch.__version__
Out[636]: '0.3.0.post4'

But in Tensor is OK
In [3]: torch.Tensor([float('inf')]).sum()
Out[3]: inf


BTW,  generally  how to handle the inf in Variable or Tensor?