Solved by ptrblck in post #2 
              
              
                Your code is working on my machine: 
dataset = datasets.MNIST(root='/home/ptrblck/python/data/', transform=transform)
print(dataset[0][0].type())
> torch.DoubleTensor

Could you check again if you’ve used accidentally the wrong transform?