Hi,
This would be a problem as the optimizer might be created with the “old” parameters. And so it will try to update the old parameters and not the new ones that get the gradients.
But if your parameters actually have .grad fields that get populated during the backward. But they are all 0s then it is something to do with your network indeed.
You want to make sure that no part of your net/loss will generate an all 0 gradient. This can happen if you have special layers or bad initialization (like something that is always negative just before a relu).