Read data from the GPU?

Hi - simple and dumb question, I have the loss that is computed on the GPU, but I want to extract it and use it back at the CPU. How do I transfer a [torch.cuda.FloatTensor of size 1 (GPU 0)] back to the CPU?


There’s a function .cpu() which is probably what you need.
Probably you could also just access by indexing: variable_lives_on_cpu = mycudatensor[0]

1 Like