The input tensor or the model parameters seem to be DoubleTensors while the others are FloatTensors. You could transform the data type via model.float() or tensor.float() depending which of these two objects is using the double type.