Thanks for reply!
I have solved the bug myself(when edit the question),and thanks a lot,again!
I will close this question
Actually, I think the error warning has some problems.
My error warning is “Require CPUfloat tensor but meet CudaFloat tensor”,but actually my error appears when I forget to .cuda()one input in the net. And this error warning misleads me for a while.
Well, I also find that torch.sum()function 's prompt message has a little problem, because the input arguments don’t has dim prompt,which contradicts to the document.