Sorry, I didn’t make myself clear. The code is like this:
def forward(self, x):
    x = conv1(x)
    x = conv2(x)
  

After calculating the conv1, the memory of the very first x should be free since it is useless anynore. But pytorch dose not free it. Is any solution to free the input x after the conv1.