change tensors dtype pytorch code example Example: pytorch convert tensor dtype x.type(torch.DoubleTensor)