Understanding backprop for softmax
Be aware that posting code in images very annoying to copy/paste and it's bad for web reference ment.

This is due to the derivative of the softmax, but to me it's seems fishy.

If $S$ is the softmax vector, then the Jacobian $DS$ consists of $S_j(\delta_{ij}-S_i)$. This could explain the -=1 part, but not the /=N, and not the shape either.