.grad() with Eigen types

I should be able to do something like the following, correct? Given some f that we can suppose worked with std::vector types:

Eigen::Matrix<stan::math::var, -1, 1> x;
stan::math::var fx;
fx = stan::math::f(x);
Eigen::Matrix<double, -1, 1> grads;
fx.grad(x, grads);

Seems to not be compiling with Eigen types, but I thought this was enabled a while ago, given this PR: https://github.com/stan-dev/math/pull/1952/files#diff-15483e8031c80b1a8917bfc8f0252b9afe4ef552c5cb049609a9a9d4b7ec622e

Main questions: does grad() work with Eigen column vectors?


You just need to change to function call to:

grad(fx, x, grads)

See the function definition for more info: https://github.com/stan-dev/math/blob/develop/stan/math/rev/fun/grad.hpp