11 if (
auto i = augmented.find(def); i != augmented.end())
return i->second;
12 augmented[def] =
augment_(def, f, f_diff);
13 return augmented[def];
17 if (
auto i = derived.find(def); i != derived.end())
return i->second;
27 auto arg = ad_app->arg();
28 DLOG(
"found a autodiff::autodiff of {}", arg);
34 assert(0 &&
"not implemented");
static auto isa(const Def *def)
const Def * derive_(const Def *)
Additionally to the derivation, the pullback is registered and the maps are initialized.
const Def * augment_(const Def *, Lam *, Lam *)
Rewrites the given definition in a lambda environment.
const Def * augment(const Def *, Lam *, Lam *)
Applies to (open) expressions in a functional context.
const Def * rewrite(const Def *) override
Detect autodiff calls.
const Def * derive(const Def *)
Acts on toplevel autodiff on closed terms:
#define DLOG(...)
Vaporizes to nothingness in Debug build.
The automatic differentiation Plugin