The memory still cannot be collected completely.
my test code is like this:

import torch
import torchvision


net = torchvision.models.resnet101()
net.cuda()
net.eval()

_ = input()
inten = torch.randn((32, 3, 224, 224)).cuda()


for i in range(10):
    out = net(inten)
    print(out.shape)


_ = input()
net.cpu()
torch.cuda.empty_cache()
_ = input()


It takes around 2G before the first input, then the memory boosts to 11G before the second input. After executing net.cpu() and torch.cuda.empty_cache(), there are still around 6G memory used. How could I resume the 2G state ?