Hi,
I’m not sure about the *_r variables. Most likely some some cpp reasons.
The gg* variables contain the gradient of the gradient of something.
Since the forward is I, W, b -> O
the backward is gO, I, W -> gI, gW, gb
and the double backward ggI, ggW, ggb -> ggO, gI, gW