Use a forward mode inside backend with ForwardDiff on the outside, but a reverse mode inside backend with Zygote on the outside