Computation in GPU and storage in CPU

Hi guys I am new to deep learning and pytorch , I had a doubt that is it possible for a neural network having loaded in CPU has it’s computation done in GPU but results are stored in CPU ? If so how is it coded ? thank you

adithya, this is not strictly possible with pytorch because this will be very bad performance.

However, you can move your results to CPU immediately after finishing computation:

output = model(input.cuda())
output = output.cpu()
1 Like

Thanks for your help soumith