Hi,
First thing i may be true or false. But i did faced the same issue here is the reason which i found out.Even though i made my gradients true for all layers except the one layer (last or middle) . My rest of the values are zeros same like you.Because as the gradient is calculated with respect to all the network parameters the layer which is set requiregrad=False acts like a wall and nothing passes through it so theoretically all the values left side of the layer(requiregrad=False) will be zero but right side will behave normally.