ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci::RemoveFakeQuantPass Struct Referencefinal

Class to Remove FakeQuant node. More...

#include <RemoveFakeQuantPass.h>

Collaboration diagram for luci::RemoveFakeQuantPass:

Public Member Functions

const char * name (void) const final
 
bool run (loco::Graph *g) final
 
- Public Member Functions inherited from logo::Pass
virtual ~Pass ()=default
 

Detailed Description

Class to Remove FakeQuant node.

Definition at line 28 of file RemoveFakeQuantPass.h.

Member Function Documentation

◆ name()

const char * luci::RemoveFakeQuantPass::name ( void  ) const
inlinefinalvirtual

Reimplemented from logo::Pass.

Definition at line 30 of file RemoveFakeQuantPass.h.

30{ return "luci::RemoveFakeQuantPass"; }

◆ run()

bool luci::RemoveFakeQuantPass::run ( loco::Graph g)
finalvirtual

BEFORE

[CircleNode] | [CircleFakeQuant] | [CircleNode]

AFTER

[CircleNode] | [CircleNode] [CircleFakeQuant]

CircleFakeQuant OP will be removed from the output graph

Implements logo::Pass.

Definition at line 54 of file RemoveFakeQuantPass.cpp.

55{
56 bool changed = false;
57 for (auto node : loco::active_nodes(loco::output_nodes(g)))
58 {
59 auto target_node = dynamic_cast<luci::CircleFakeQuant *>(node);
60 if (target_node != nullptr)
61 {
62 remove_fake_quant(target_node);
63 changed = true;
64 }
65 }
66 return changed;
67}
FAKE_QUANT in Circle.
std::set< loco::Node * > active_nodes(const std::vector< loco::Node * > &roots)
Enumerate all the nodes required to compute "roots".
std::vector< Node * > output_nodes(Graph *)
Definition Graph.cpp:101

References loco::active_nodes(), and loco::output_nodes().

Referenced by package.infer.session::inference().


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