ONE - On-device Neural Engine
Loading...
Searching...
No Matches
fme_apply::FMEqualizer Class Referencefinal

#include <FMEqualizer.h>

Public Member Functions

void equalize (loco::Graph *g, std::vector< EqualizePattern > &p)
 

Detailed Description

Definition at line 27 of file FMEqualizer.h.

Member Function Documentation

◆ equalize()

void fme_apply::FMEqualizer::equalize ( loco::Graph g,
std::vector< EqualizePattern > &  p 
)

Definition at line 63 of file FMEqualizer.cpp.

64{
65 THROW_UNLESS(g != nullptr, "Invalid argument g");
66
67 // Check the patterns are valid on the graph
69
70 // Insert Scale/Shift based on patterns
71 InsertScaleShift issp(p);
72 issp.run(g);
73
74 logo::Phase phase;
75
76 // Default passes
77 phase.emplace_back(std::make_unique<logo::RemoveDeadNodeWithQueryPass>());
78 phase.emplace_back(std::make_unique<luci::CircleShapeInferencePass>());
79 phase.emplace_back(std::make_unique<luci::CircleTypeInferencePass>());
80
81 // Fuse Pre/Post Scale
82 phase.emplace_back(std::make_unique<fme_apply::FusePreScalePass>());
83 phase.emplace_back(std::make_unique<fme_apply::FusePostScalePass>());
84
87 phase_runner.attach(&prog);
88 phase_runner.run(phase);
89
90 // Check if all Scale/Shift nodes are removed
91 check_no_scale(g);
92}
#define THROW_UNLESS(COND, MSG)
Class to insert scale/shift virtual Ops to loco::Graph.
void check_patterns_valid(loco::Graph *g, const std::vector< EqualizePattern > &patterns)
std::vector< std::unique_ptr< Pass > > Phase
Definition Phase.h:31

References fme_apply::check_patterns_valid(), fme_apply::InsertScaleShift::run(), logo::Saturate, and THROW_UNLESS.

Referenced by entry().


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