May 30, 2024
Good question, in pytorch a,b and c are conencted using a computational graph, so the grad of c will change the grad of a and b.
I will recommend Karpathy's backpropagation video to understand how grads flow backwards in a computational graph.