How to free-up GPU memory in pyTorch 0.2.x?

Hi,

I am using PyTorch 0.2.X version.

What is the best way to clear memory of GPU in this version? I see even if my notebook is not doing anything, the memory of GPU is still high.

In 0.3.x we have one method.

torch.cuda.empty_cache()

What can be a possible option in 0.2.x?

Should I just kill the process?

Thanks in advance

Yeah I just restart the kernel.