You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
All make_partials_propagator to return its input args as a tuple #3423
When a user calls something like normal_lpdf(std::move(y), std::move(mu), std::move(sigma)) nothing really happens with the moved memory. But we could actually move those objects into the partials_propagator so that the partials_propagator does not have to make a hard copy of the inputs. A nice piece would be if make_partials_propagator returned a tuple of the partials propagator and references to the moved memory so that the functions would reuse that local memory.
auto [partials_prop, y_ref, mu_ref, sigma_ref] = make_partials_propagator(
std::move(y), std::move(mu), std::move(sigma));
For autodiff types the inputs would be moved into the partials propagator and then references to the object would be the return. For non-autodiff types the object would just be passed back
This would replace a lot of the ref_type_t boilerplate inside of the distributions since the values would then sit inside of the partials propagator.
Activity