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

Class to Remove Quantize-Dequantize sequence. More...

#include <RemoveQuantDequantSeqPass.h>

Collaboration diagram for luci::RemoveQuantDequantSeqPass:

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 Quantize-Dequantize sequence.

Definition at line 28 of file RemoveQuantDequantSeqPass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 30 of file RemoveQuantDequantSeqPass.h.

30{ return "luci::RemoveQuantDequantSeqPass"; }

◆ run()

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

BEFORE

  [CircleNode]
       |
[CircleQuantize]
       |

[CircleDequantize] | [CircleNode]

AFTER

[CircleNode] [CircleQuantize] | | [CircleNode] [CircleDequantize]

CircleQuant-CircleDequant sequance will be removed from the output graph

Implements logo::Pass.

Definition at line 62 of file RemoveQuantDequantSeqPass.cpp.

63{
64 bool changed = false;
65 for (auto node : loco::active_nodes(loco::output_nodes(g)))
66 {
67 auto target_node = dynamic_cast<luci::CircleDequantize *>(node);
68 if (target_node != nullptr)
69 {
70 if (remove_quant_dequant(target_node))
71 changed = true;
72 }
73 }
74 return changed;
75}
DEQUANTIZE 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: