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

◆ build()

template<typename ReturnType , typename... Ops>
var stan::math::internal::partials_propagator< ReturnType, require_var_t< ReturnType >, Ops... >::build ( double  value)
inline

Build the node to be stored on the autodiff graph.

This should contain both the value and the tangent.

For scalars, we don't calculate any tangents. For reverse mode, we end up returning a type of var that will calculate the appropriate adjoint using the stored operands and partials. Forward mode just calculates the tangent on the spot and returns it in a vanilla fvar.

Parameters
valuethe return value of the function we are compressing
Returns
the node to be stored in the expression graph for autodiff

Definition at line 75 of file partials_propagator.hpp.