The torch computation graph is composed of grad_fn. For the terminating node, the grad_fn object has an attribute called next_functions which is a tuple. I understand that using the first element (0th index) of the tuple, I can reconstruct the computation graph for gradients. But I was wondering what does the second element (1st index) of the tuple mean?
In one of the answers in PyTorch forums, it is said that:
The number is the input number to the next backward function, so can only be non-zero when a function has multiple differentiable outputs (there aren’t that many, but e.g. the RNN functions typically do).
But I am don't understand this statement. Can someone explain this with an example perhaps?