ONE - On-device Neural Engine
Loading...
Searching...
No Matches
moco::tf::Canonicalizer Class Referencefinal

#include <Canonicalizer.h>

Public Member Functions

void canonicalize (loco::Graph *) const
 

Detailed Description

Definition at line 27 of file Canonicalizer.h.

Member Function Documentation

◆ canonicalize()

void moco::tf::Canonicalizer::canonicalize ( loco::Graph g) const

Definition at line 88 of file Canonicalizer.cpp.

89{
90 logo::Phase phase;
91
92 /* TRANSFORM DECLARATION BEGIN */
93 // Run shape and type inference at the top
94 phase.emplace_back(std::make_unique<ShapeInferencePass>());
95 phase.emplace_back(std::make_unique<TypeInferencePass>());
96
97 phase.emplace_back(std::make_unique<AddCanonicalizer>());
98 phase.emplace_back(std::make_unique<AvgPoolCanonicalizer>());
99 if (moco::tf::get<moco::tf::Knob::CanonicalizeBiasAdd>())
100 phase.emplace_back(std::make_unique<BiasAddCanonicalizer>());
101 phase.emplace_back(std::make_unique<ConcatV2Canonicalizer>());
102 if (moco::tf::get<moco::tf::Knob::CanonicalizeConst>())
103 phase.emplace_back(std::make_unique<ConstCanonicalizer>());
104 phase.emplace_back(std::make_unique<Conv2DBackpropInputCanonicalizer>());
105 if (moco::tf::get<moco::tf::Knob::CanonicalizeConv2D>())
106 phase.emplace_back(std::make_unique<Conv2DCanonicalizer>());
107 phase.emplace_back(std::make_unique<DepthwiseConv2dNativeCanonicalizer>());
108 phase.emplace_back(std::make_unique<IdentityCanonicalizer>());
109 phase.emplace_back(std::make_unique<MaximumCanonicalizer>());
110 phase.emplace_back(std::make_unique<MaxPoolCanonicalizer>());
111 phase.emplace_back(std::make_unique<MeanCanonicalizer>());
112 phase.emplace_back(std::make_unique<MulCanonicalizer>());
113 phase.emplace_back(std::make_unique<PadCanonicalizer>());
114 phase.emplace_back(std::make_unique<PlaceholderCanonicalizer>());
115 phase.emplace_back(std::make_unique<RealDivCanonicalizer>());
116 phase.emplace_back(std::make_unique<ReluCanonicalizer>());
117 phase.emplace_back(std::make_unique<Relu6Canonicalizer>());
118 phase.emplace_back(std::make_unique<ReshapeCanonicalizer>());
119 phase.emplace_back(std::make_unique<RsqrtCanonicalizer>());
120 phase.emplace_back(std::make_unique<SoftmaxCanonicalizer>());
121 phase.emplace_back(std::make_unique<SqrtCanonicalizer>());
122 // NOTE SquaredDifference is handled in ResolveSquaredDifference
123 phase.emplace_back(std::make_unique<SqueezeCanonicalizer>());
124 phase.emplace_back(std::make_unique<StopGradientCanonicalizer>());
125 phase.emplace_back(std::make_unique<SubCanonicalizer>());
126 phase.emplace_back(std::make_unique<TanhCanonicalizer>());
127 // For virtual nodes
128 phase.emplace_back(std::make_unique<TFPushCanonicalizer>());
129 /* TRANSFORM DECLARATION END */
130
131 ProgressReporter prog(g, logo::PhaseStrategy::Restart);
133 phase_runner.attach(&prog);
134 phase_runner.run(phase);
135
136 // Assert if graph has TF dialect nodes
137 assert(!has_tf_nodes(g));
138}
std::vector< std::unique_ptr< Pass > > Phase
Definition Phase.h:31

References logo::Restart.


The documentation for this class was generated from the following files: