It depends a bit on your use case and what you are trying to achieve?
I.e. since you are already updating the model in the inner loop, the outer backward call should be removed.
Alternatively, you could also remove the inner backward and step call and update the model in the outer loop.