8namespace plug::autodiff {
90#define MIM_autodiff_NORMALIZER_IMPL \
91 void register_normalizers(Normalizers& normalizers) {\
92 normalizers[flags_t(Annex::Base<Tangent>)] = &normalize_Tangent; \
93 normalizers[flags_t(Annex::Base<AD>)] = &normalize_AD; \
94 normalizers[flags_t(Annex::Base<ad>)] = &normalize_ad; \
95 normalizers[flags_t(Annex::Base<zero>)] = &normalize_zero; \
96 normalizers[flags_t(Annex::Base<add>)] = &normalize_add; \
97 normalizers[flags_t(Annex::Base<sum>)] = &normalize_sum; \
124template<>
struct Axiom::Match<plug::autodiff::ad_eval_pass> {
using type =
Axiom; };
125template<>
struct Axiom::Match<plug::autodiff::ad_zero_pass> {
using type =
Axiom; };
126template<>
struct Axiom::Match<plug::autodiff::ad_zero_cleanup_pass> {
using type =
Axiom; };
127template<>
struct Axiom::Match<plug::autodiff::ad_ext_cleanup_pass> {
using type =
Axiom; };
Helper class to retrieve Infer::arg if present.
Ref normalize_Tangent(Ref, Ref, Ref arg)
static constexpr plugin_t Plugin_Id
Ref normalize_sum(Ref type, Ref callee, Ref arg)
Ref normalize_ad(Ref type, Ref callee, Ref arg)
Currently this normalizer does nothin.
Ref normalize_AD(Ref type, Ref callee, Ref arg)
Ref normalize_add(Ref type, Ref callee, Ref arg)
Currently resolved the full addition.
Ref normalize_zero(Ref type, Ref callee, Ref arg)
Currently this normalizer does nothing.
void register_normalizers(Normalizers &normalizers)
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
static constexpr size_t Num
static constexpr flags_t Base