How can i convert model's parameter data type to Double?

Default data type of parameters is Float.
I want to convert it to Double.
How can i do this?

1 Like

You can convert your model to double by doing model.double().
Note that after this, you will need your input to be DoubleTensor.


Thanks very much! It’s very simple.

Convert Your Data to float instead … as it’s very dangerous to convert model type to Double … as GPUs are not good at double precision computation

X_train = torch.FloatTensor(X_train)