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
I'm looking at pp_statement trying to make some changes when a Decl is happening, but I only want to make this change whenever I am declaring parameters. Is there information within pp_statement that I can use to tell that I am in the parameters block? If I can then I think I can do a small trick like #865 to make one copy of the parameters on the AD stack. So if someone did someting like
And it also breaks transform_inits() so need to wait on Ryan's PR for cleaning that up before we think more about this (which is waiting on a PR in the Stan repo).
I think what I actually want is a DeclAssign that can take where stanc breaks up the deceleration and assignment into a Decl and Assign right now like
Then once I can tell I'm in the parameters block with that DeclAssign I can do
auto p_vec = in__.template read_constrain_lb<Eigen::Matrix<local_scalar_t__, -1, 1>, jacobian__>(0, lp__, N);
Then in deserializer when the input type is a var I can just return an arena matrix so no copies happen for matrix and vector parameters when it's used in other functions.
I'm looking at
pp_statement
trying to make some changes when aDecl
is happening, but I only want to make this change whenever I am declaring parameters. Is there information withinpp_statement
that I can use to tell that I am in the parameters block? If I can then I think I can do a small trick like #865 to make one copy of the parameters on the AD stack. So if someone did someting likeThe only memory creation that happens here is for the new matrix
transform_x
The text was updated successfully, but these errors were encountered: