What exactly does Loss.cuda() do?

I’m asking because I’m wondering if my custom losses are working on GPU optimally.

If I move all the tensors on to the GPU by doing a .cuda() on them, is there anything else that model.cuda() does that I haven’t done?

Loss.cuda() doesn’t do anything. model.cuda() transfers it’s learnable parameters on to GPU, but losses usually dont have parameters.

5 Likes