I know that .cpu()
will copy data out of the GPU, but how do I move data off the GPU?
One way to move data - for example x
- off the GPU is to call x.cpu()
and then call del x
. This will free the memory. To check that the memory has been freed you can call torch.cuda.empty_cache()
.
1 Like