Hi,
We should update this error message  We have an issue open for that somewhere.
It just means that a leaf Tensor (so a Tensor with no history that requires grad) has been modified inplace in a differentiable manner.
In your case, this is because your optimizer runs in a differentiable manner while it shouldn’t.
I think you’re missing the @torch.no_grad decorator for your step function that is in the pytorch optimizers