AttributeError: 'FloatTensor' object has no attribute 'requires_grad'

I use BCELoss but the output of my model is tensor.FloatTensor, how to change it?

the output of your model needs to be Variable, not FloatTensor

1 Like

Thanks for your help!