I found that one can use
model.to(torch::kDouble);
to cast parameters of the whole model to double type.