Hi,
The autograd will compute the gradient of the op.
So a good mental model is how much the output varies if you change the input by an epsilon.
Here you see that if c2 moves by eps, nothing changes (except close to 0 but that is a special case). So the gradient flowing back along c2 will be 0.
For c1, all the values that were overwritten as well, if you change them, it does not change the result. So the gradient is going to be 0 for them
For the values that were kept as-is, then the gradient will be exactly the same as the one flowing from e1.
All the indexing/torch.where, etc will follow this logic and will give you the same gradient.