How to tell when a statement is in data/transformed data/parameters/transformed parameters, etc? #876
-
I'm looking at matrix[N, M] transform_x = multiply(data_matrix,, param_vector) The only memory creation that happens here is for the new matrix |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There's not. That information is in let pp_toplevel_statement (params : String.Set.t) ppf stmt =
match stmt.Stmt.Fixed.pattern with
| Decl {decl_adtype; decl_id; decl_type} when Set.mem params decl_id ->
pp_decl ppf (decl_id, decl_type, decl_adtype)
| _ -> pp_statement ppf stmt or it might make sense to add a new |
Beta Was this translation helpful? Give feedback.
-
I sort of got something that does this, but it feels hacky https://github.com/stan-dev/stanc3/compare/master...SteveBronder:feature/no-param-setup?expand=1 And it also breaks I think what I actually want is a Eigen::Matrix<local_scalar_t__, -1, 1> p_vec;
current_statement__ = 9;
p_vec = in__.template read_constrain_lb<Eigen::Matrix<local_scalar_t__, -1, 1>, jacobian__>(
0, lp__, N); So we can can just do this Eigen::Matrix<local_scalar_t__, -1, 1> p_vec =
in__.template read_constrain_lb<Eigen::Matrix<local_scalar_t__, -1, 1>, jacobian__>(0, lp__, N); Then once I can tell I'm in the parameters block with that 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 |
Beta Was this translation helpful? Give feedback.
There's not. That information is in
program.output_vars
only.You could either have a new function like
or it might make sense to add a new
is_mappable : bool
field toDecl
inmiddle/Stmt.ml
.