Hello,everyone.
out = net(input)
Target = Variable(t.arange(0,10))
Criterion = nn.MSELoss()
Loss = Criterion(out,Target)
Print(Loss)

when i run it ,which give me a mistake.

image1130×566 13.7 KB

And i know how to correct it ，just replace Target = Variable(t.arange(0,10)) with Target = Variable(t.arange(0,10)).float()
why float?
Thank you!!!