Is there a way to release GPU memory in libtorch?

check this How to effectively release a Tensor in Pytorch? - #2 by ptrblck