1.
torch.FloatTensor(2,3).normal_(0,1)
torch.LongTensor(2,3).random(0,4)
torch.FloatTensor/Tensor(arr) it don't share mem, so this method is slow
torch.from_numpy(arr).float() <*>
data.float()
data.long()
model.float()
data.__class__ / numpy.ndarray.dtype
--------------------------------------
1. https://discuss.pytorch.org/t/problems-with-weight-array-of-floattensor-type-in-loss-function/381/4
2. https://discuss.pytorch.org/t/problems-with-target-arrays-of-int-int32-types-in-loss-functions/140