Thanks for your example very much.
I get your point.
need to make sure the tensors and parameters are on the appropriate device when model computing,
need to make sure the finally out and target are on the same device when calling backward,
thanks again.