FloatMSECriterion_updateOutput received an invalid combination of arguments

Hi all,

I have a float label ( label = label.astype(‘float’) ) in data_loader when I realize the Regression model.
However, I met the following type error:

TypeError: FloatMSECriterion_updateOutput received an invalid combination of arguments - get (int, torch.FloatTensor, torch.DoubleTensor, torch.FloatTensor, bool), but expected (int state, torch.FloatTensor input, torch.FloatTensor target, torch.FloatTensor output, bool sizeAverage)

How can I change the torch.DoubleTensor to torch.FloatTensor??

Thanks.

In numpy the flag 'float' corresponds to 'float64' by default.
You could change the line to:

label = label.astype('float32')

and run it again.

It works well.
Thank you very much.