Access a list of values separately but calculate them together. This function generalizes grad_share for any number of functions.
Useful links