I’m working on the gradients for a function where one of the inputs has the signature
std::vector<Eigen::Matrix<T, Eigen::Dynamic, 1> > (i.e. an array of vectors), and I’m having some trouble with
The gradients are entered as:
operands_and_partials<T_theta, T_lam> ops_partials(theta, lambda);
ops_partials.edge1_.partials_ = theta_deriv;
ops_partials.edge2_.partials_ = lam_deriv;
lam_deriv are arrays of vectors.
The function and test runs fine when working with
math/prim, but both
rev fail with the error “
no member named partials_”
rev work perfectly with
ops_partials.edge2_.partials_vec_ = lam_deriv;
This then causes the
prim test to fail, because there’s no definition for
partials_vec_ in the
prim/scal version of operands_and_partials (but it’s mentioned in the doxygen, so it looks like it was there at some point?).
Is there a better way of entering the gradients in this case?