torch.from_numpy keeps the dtype.
If you initialize the numpy array with 0, it will result in t being a LongTensor, while 0. yields a FloatTensor.
The method torch.exp is not implemented for LongTensors, which throws this error.