After I tried several times, I found that’s not the key.
Now I wonder what graph buffers and when will pytorch free?  The graph buffers mean all the Variables(including require_grad=True and require_grad=False)?