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

#include <TFOptimizer.h>

Public Member Functions

void optimize (loco::Graph *) const
 

Detailed Description

Definition at line 27 of file TFOptimizer.h.

Member Function Documentation

◆ optimize()

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

Definition at line 32 of file TFOptimizer.cpp.

33{
34 logo::Phase phase;
35
36 /* TRANSFORM DECLARATION BEGIN */
37 if (moco::tf::get<moco::tf::Knob::ResolveFusedBatchNorm>())
38 {
39 phase.emplace_back(std::make_unique<moco::ResolveFusedBatchNorm>());
40 }
41 if (moco::tf::get<moco::tf::Knob::FuseBinaryIntoPreceding>())
42 {
43 phase.emplace_back(std::make_unique<moco::FuseBinaryIntoPreceding>());
44 }
45 if (moco::tf::get<moco::tf::Knob::ResolveConstantShape>())
46 {
47 phase.emplace_back(std::make_unique<moco::ResolveConstantShape>());
48 }
49 if (moco::tf::get<moco::tf::Knob::ResolveReshapeWildcardDim>())
50 {
51 phase.emplace_back(std::make_unique<moco::ResolveReshapeWildcardDim>());
52 }
53 if (moco::tf::get<moco::tf::Knob::ResolveSquaredDifference>())
54 {
55 phase.emplace_back(std::make_unique<moco::ResolveSquaredDifference>());
56 }
57 if (moco::tf::get<moco::tf::Knob::RemoveTFIdentityNode>())
58 {
59 phase.emplace_back(std::make_unique<moco::RemoveTFIdentityNode>());
60 }
61 if (moco::tf::get<moco::tf::Knob::RemoveDeadNode>())
62 {
63 phase.emplace_back(std::make_unique<logo::RemoveDeadNodePass>());
64 }
65 if (moco::tf::get<moco::tf::Knob::SqueezeReduceNode>())
66 {
67 phase.emplace_back(std::make_unique<moco::SqueezeReduceNode>());
68 }
69 // Shape inference is needed for added nodes doing above transformations
70 phase.emplace_back(std::make_unique<moco::tf::ShapeInferencePass>());
71 phase.emplace_back(std::make_unique<moco::tf::TypeInferencePass>());
72 /* TRANSFORM DECLARATION END */
73
74 ProgressReporter prog(g, logo::PhaseStrategy::Saturate);
76 phase_runner.attach(&prog);
77 phase_runner.run(phase);
78}
std::vector< std::unique_ptr< Pass > > Phase
Definition Phase.h:31

References logo::Saturate.


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