I encapsulate model loading and forward calculating into a class using libtorch,and want to release the gpu memory(including model) while destroy the class.
I have tried c10::cuda::CUDACachingAllocator::emptyCache(), but it doesn’t seem to be working.