Solved by ptrblck in post #2 
              
              
                Inplace operations can overwrite values required to compute gradients and might thus yield an error message such as: 
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [1024]], which is output 0 of LeakyReluBackward1, is …