If this code works, it would mean that indeed the model uses float32 for its parameters, which is also the default. You could check it with print(model.hidden1.weight.dtype). However, in my setup at least I’m getting a different order of expected types:
lin = nn.Linear(10, 10) # lin uses float32 parameters
x = torch.randn(1, 10).double()
lin(x)
> RuntimeError: expected scalar type Float but found Double

In any case, make sure the model and input use the same dtype.
If you want to use DoubleTensors, call .double() on the tensors and model.