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

#include <Optimizer.h>

Public Member Functions

void optimize (loco::Graph *) const
 

Detailed Description

Definition at line 27 of file Optimizer.h.

Member Function Documentation

◆ optimize()

void moco::tf::Optimizer::optimize ( loco::Graph g) const

Definition at line 32 of file Optimizer.cpp.

33{
34 logo::Phase phase;
35
36 /* TRANSFORM DECLARATION BEGIN */
37 // Shape inference is required for ResolveRedundantReshape
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 {
53 phase.emplace_back(std::make_unique<logo::ReorderDecodePass<loco::TensorBiasAdd>>());
54 }
55
56 if (moco::tf::get<moco::tf::Knob::ReorderDecode>() &&
57 moco::tf::get<moco::tf::Knob::ReorderDecodeReLU>())
58 {
59 phase.emplace_back(std::make_unique<logo::ReorderDecodePass<loco::ReLU>>());
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 /* TRANSFORM DECLARATION END */
82
83 ProgressReporter prog(g, logo::PhaseStrategy::Saturate);
85 phase_runner.attach(&prog);
86 phase_runner.run(phase);
87}
std::vector< std::unique_ptr< Pass > > Phase
Definition Phase.h:31
Reorder XXXDecode -> ? as ? -> XXXDecode if possible.

References logo::Saturate.


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