89{
91
92
93
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
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
128 phase.emplace_back(std::make_unique<TFPushCanonicalizer>());
129
130
133 phase_runner.attach(&prog);
134 phase_runner.run(phase);
135
136
137 assert(!has_tf_nodes(g));
138}
std::vector< std::unique_ptr< Pass > > Phase