Skip to content

Commit a8ab023

Browse files
committed
update docs
1 parent f5d49a6 commit a8ab023

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

stan/math/rev/core/arena_matrix.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ class arena_matrix : public Eigen::Map<MatrixType> {
128128
Base::operator=(a);
129129
return *this;
130130
}
131+
/**
132+
* Forces hard copying matrices into an arena matrix
133+
* @tparam T Any type assignable to `Base`
134+
* @param x the values to write to `this`
135+
*/
131136
template <typename T>
132137
void hard_copy(const T& x) {
133138
Base::operator=(x);

stan/math/rev/core/var.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ class var_value<T, internal::require_matrix_var_value<T>> {
390390
reverse_pass_callback(
391391
[this_vi = this->vi_, other_vi = other.vi_]() mutable {
392392
other_vi->adj_ += this_vi->adj_;
393-
//
393+
// Reset the adjoint for `this` to replicate SoA before assignment
394394
this_vi->adj_.setZero();
395395
});
396396
}

0 commit comments

Comments
 (0)