What exactly does Loss.cuda() do?

(Spandan Madan) #1

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.