Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ reverse_pass_callback()

template<typename F >
void stan::math::reverse_pass_callback ( F &&  functor)
inline

Puts a callback on the autodiff stack to be called in reverse pass.

The intended use case is for the callable to ba a lambda function that captures any arguments it needs to work with. All captured values must be trivially destructible or they will leak memory! to_AD_stack() function can be used to ensure that.

Template Parameters
Ftype of callable
Parameters
functorfuntor or other callable to call in the reverse pass

Definition at line 38 of file reverse_pass_callback.hpp.