Stan Math Library
4.9.0
Automatic Differentiation
|
|
inline |
Compute, using nested autodiff, the value and Jacobian of ReduceFunction
called over the range defined by r and accumulate those in member variable sum_ (for the value) and args_adjoints_ (for the Jacobian).
The nested autodiff uses deep copies of the involved operands ensuring that no side effects are implied to the adjoints of the input operands which reside potentially on a autodiff tape stored in a different thread other than the current thread of execution. This function may be called multiple times per object instantiation (so the sum_ and args_adjoints_ must be accumulated, not just assigned).
r | Range over which to compute reduce_sum |
Definition at line 97 of file reduce_sum.hpp.