Stan Math Library
4.9.0
Automatic Differentiation
|
internal::callback_vari< plain_type_t< T >, F > * stan::math::make_callback_vari | ( | T && | value, |
F && | functor | ||
) |
Creates a new vari with given value and a callback that implements the reverse pass (chain).
The callback needs to accept a referenct to the vari. If it needs any other data it should be implemented as a lambda capturing the variables it needs.
All captured values must be trivially destructible or they will leak memory! to_arena()
function can be used to ensure that.
T | type of value |
F | type of callable |
value | value of the vari |
functor | functor or other callable to call in the reverse pass |
Definition at line 41 of file callback_vari.hpp.