Looks like for super small input, the log_softmax would fail anyway.
For example
In [127]: z = th.DoubleTensor(np.array([1e-15, 2e-15, 3e-15]))

In [128]: F.log_softmax(z, dim=0)
Out[128]: tensor([-1.0986, -1.0986, -1.0986], dtype=torch.float64)

it returns the same value for the 3 input values.