Automatic Differentiation
 
Loading...
Searching...
No Matches
set_zero_all_adjoints.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_REV_CORE_SET_ZERO_ALL_ADJOINTS_HPP
2#define STAN_MATH_REV_CORE_SET_ZERO_ALL_ADJOINTS_HPP
3
7
8namespace stan {
9namespace math {
10
14static inline void set_zero_all_adjoints() {
15 for (auto &x : ChainableStack::instance_->var_stack_) {
16 x->set_zero_adjoint();
17 }
19 x->set_zero_adjoint();
20 }
21}
22
23} // namespace math
24} // namespace stan
25#endif
static void set_zero_all_adjoints()
Reset all adjoint values in the stack to zero.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
static thread_local AutodiffStackStorage * instance_