How do i clear all the variables, that are stored in GPU via cuda programming,after its use, so that memory can be effectively managed
nstrek
(Nikolay Strekopytov)
2
You can try this snippet:
import gc
gc.collect()
with torch.no_grad():
torch.cuda.empty_cache()
and read: