AD of pow<fvar<var>>(0, 0) causes NAN adjoint. pow<fvar<var>>(0, 0) and pow<var>(0, 0) both behave as expected.
Update
pow<var>(0, 0) should return NAN adjoint since the partials are undefined.
Steps to reproduce
stan::math::nested_rev_autodiff nested{};
stan::math::var t{0.0};
auto foo = stan::math::pow(t,0);
foo.grad();
assert(not std::isfinite(t.adj())); // fails
Current Version:
v4.7.0
AD ofpow<fvar<var>>(0, 0)causes NAN adjoint.pow<fvar<var>>(0, 0)andpow<var>(0, 0)both behave as expected.Update
pow<var>(0, 0)should return NAN adjoint since the partials are undefined.Steps to reproduce
stan::math::nested_rev_autodiff nested{}; stan::math::var t{0.0}; auto foo = stan::math::pow(t,0); foo.grad(); assert(not std::isfinite(t.adj())); // failsCurrent Version:
v4.7.0