So that means that an input to your linear layer was modified inplace.
Since from the stack trace you clone the input to make sure it is not this one, then I guess it is the weights, which are most like modified by your optimizer when you do optimizer.step() ?