33{
35
36
37
38 phase.emplace_back(std::make_unique<ShapeInferencePass>());
39
40 if (moco::tf::get<moco::tf::Knob::ConstantFolding>())
41 {
42 phase.emplace_back(std::make_unique<logo::ConstantFoldingPass>());
43 }
44
45 if (moco::tf::get<moco::tf::Knob::RemoveDeadNode>())
46 {
47 phase.emplace_back(std::make_unique<logo::RemoveDeadNodePass>());
48 }
49
50 if (moco::tf::get<moco::tf::Knob::ReorderDecode>() &&
51 moco::tf::get<moco::tf::Knob::ReorderDecodeTensorBiasAdd>())
52 {
54 }
55
56 if (moco::tf::get<moco::tf::Knob::ReorderDecode>() &&
57 moco::tf::get<moco::tf::Knob::ReorderDecodeReLU>())
58 {
60 }
61
62 if (moco::tf::get<moco::tf::Knob::SimplifyDomainConversion>())
63 {
64 phase.emplace_back(std::make_unique<logo::SimplifyDomainConversionPass>());
65 }
66
67 if (moco::tf::get<moco::tf::Knob::RemoveForwardNode>())
68 {
69 phase.emplace_back(std::make_unique<logo::RemoveForwardNodePass>());
70 }
71
72 if (moco::tf::get<moco::tf::Knob::ResolveDuplicateReshape>())
73 {
74 phase.emplace_back(std::make_unique<logo::ResolveDuplicateReshapePass>());
75 }
76
77 if (moco::tf::get<moco::tf::Knob::ResolveRedundantReshape>())
78 {
79 phase.emplace_back(std::make_unique<logo::ResolveRedundantReshapePass>());
80 }
81
82
85 phase_runner.attach(&prog);
86 phase_runner.run(phase);
87}
std::vector< std::unique_ptr< Pass > > Phase
Reorder XXXDecode -> ? as ? -> XXXDecode if possible.