Legitimate way to move module or tensor to GPU?


(jdhao) #1

I have seen two ways to move module or tensor to GPU:

Is there any difference between these two methods in terms of moving module or tensor to GPU? Which method is preferred?


(Simon Wang) #2

No

.to is preferred because you can define a device object and use it everywhere.