Hi,
The fact that we use a DCG does not change at all how the gradients updates are made.
In pytorch the classic way to handle gradient updates is to use the optimisers in the torch.optim package.
Even the way the gradients are computed does not change compared to a system with static graph: we use the chain rule for every operation (also called backpropagation).
The only difference with static graph systems is that instead of building a graph of what computations should be performed, then perform them, the graph is built while the computations are performed. But the computations and backward passes represented by both these graphs are exactly the same and will give you exactly the same gradients.