Solved by RicCu in post #2 
              
              
                type() is an older method that works only with the tensor types (e.g. DoubleTensor, HalfTensor, etc.), whereas to() was added in 0.4 along with the introduction of dtypes (e.g. torch.float, torch.half) and devices, which are more flexible. 
to() is the preferred method now.