Based on the error message (some) model parameters are DoubleTensors, while the input is a FloatTensor, so you would either have to leave the model parameters in the default dtype (or call model.float() explicitly) or alternatively transform the inputs to DoubleTensors via input = input.double().