There are only two hard things in Computer Science: cache invalidation and naming things.
– Phil Karlton
Personally, I think it’s just an “accumulator” type variable that is accumulating the results as they pass through “layers” i.e., computations for layer1, activations (aka “non linearity”,) and computations for layer2.
For conciseness, the same variable is being used and since it is being returned as a “result”, it’s also called “res” (for result). But then again, it’s also accumulating a ‘residual’ value before being returned as the result. So it could represent either, or both?
But this is all conjecture on my part. Only the authors of the above mentioned code can clarify what their true intent was/is.
HTH