int64 is equivalent to long. Therefore the ToTensor() transform simply returns a tensor of the same dtype as the given array. If you convert your image to float64 the returned type should be a DoubleTensor. If you don’t need the double precision I would recommend using float32 which leads to FloatTensor as return type. They are much more efficient in computation, use less memory and you don’t have to convert your model to double since weight and bias are usually FloatTensors as well.