Hi,
This most likely happens due to sparsity of the different elements?
Note that if you are curious about a given Tensors gradient in a more complex example, you can use hook to print them. For example here, you can do prod.register_hook(print) and it will print the gradient of prod when it’s computed. You can do the same with any other Tensor involved in the backward.