Yes these two ops are indeed inplace. What I am confused at is that since it’s in my custom layer, pytorch is not supposed to track inplace modifications and should simply run my backward pass, and thus this error should not be thrown.