Hi,
I think the prints don’t match your code. In particular, I’m not sure where the Gradients on the output nodes: comes from.
But to answer your question, this is most likely the softmax that makes the gradients dense even though they are sparse on its output (it’s actually a very useful feature of softmax!).