Encounter the RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation

Nice explanation!!
I encountered the same problem and solved it by the explanation!
Thanks