Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add var<matrix> creation methods for reader #2952

Open
SteveBronder opened this issue Aug 31, 2020 · 1 comment
Open

Add var<matrix> creation methods for reader #2952

SteveBronder opened this issue Aug 31, 2020 · 1 comment

Comments

@SteveBronder
Copy link
Collaborator

Summary:

For reader.hpp we need methods for static_matrix(i, j) and static_vector(i) to read in a static matrix. One small issue atm is that when we call log_prob_grad or log_prob_propto we pass in a vector of var types to the model's log prob that is then sent into the reader to be deserialized into the model's containers. This means that in the static_matrix etc functions we will have to do a to_var_matrix() and do a full copy. Though idt there's any non-trivial way to get rid of that copy.

Current Version:

v2.24.0

@SteveBronder
Copy link
Collaborator Author

SteveBronder commented Aug 31, 2020

The only thing I can think of is actually passing in a var<mat> to the model's log_prob and doing the unpacking for the dynamic case. On one hand that feels nice but unless we did something clever with the views in #2024 I think this would end up with more copies (since right now a "copy" of a var to a var is really just a copy of a pointer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant