RuntimeError: one of the variables needed for gradient (torch==1.3.0) computation has been modified by an inplace operation:

Because you’re trying to compute a gradient. You can’t compute gradients on Tensor which have been modified via an in-place operation, so make sure it’s set to False.

There’s a nice dicussion about it on the forums here: What is `in-place operation`? - #15 by Alex_Fann