From a8ab023e2470e29737d1ad3fd50bb2d154a4ee81 Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Mon, 27 Nov 2023 18:02:07 -0500 Subject: [PATCH] update docs --- stan/math/rev/core/arena_matrix.hpp | 5 +++++ stan/math/rev/core/var.hpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/stan/math/rev/core/arena_matrix.hpp b/stan/math/rev/core/arena_matrix.hpp index b65bed948cd..a0b24725fb7 100644 --- a/stan/math/rev/core/arena_matrix.hpp +++ b/stan/math/rev/core/arena_matrix.hpp @@ -128,6 +128,11 @@ class arena_matrix : public Eigen::Map { Base::operator=(a); return *this; } + /** + * Forces hard copying matrices into an arena matrix + * @tparam T Any type assignable to `Base` + * @param x the values to write to `this` + */ template void hard_copy(const T& x) { Base::operator=(x); diff --git a/stan/math/rev/core/var.hpp b/stan/math/rev/core/var.hpp index f02fbaec05c..5553296383e 100644 --- a/stan/math/rev/core/var.hpp +++ b/stan/math/rev/core/var.hpp @@ -390,7 +390,7 @@ class var_value> { reverse_pass_callback( [this_vi = this->vi_, other_vi = other.vi_]() mutable { other_vi->adj_ += this_vi->adj_; - // + // Reset the adjoint for `this` to replicate SoA before assignment this_vi->adj_.setZero(); }); }