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

Class to quantize nodes using their predecessors' qparam. More...

#include <QuantizeWithPredecessorPass.h>

Collaboration diagram for luci::QuantizeWithPredecessorPass:

Public Member Functions

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

Detailed Description

Class to quantize nodes using their predecessors' qparam.

Definition at line 29 of file QuantizeWithPredecessorPass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 31 of file QuantizeWithPredecessorPass.h.

31{ return "luci::QuantizeWithPredecessor"; }

◆ run()

bool luci::QuantizeWithPredecessorPass::run ( loco::Graph graph)
finalvirtual

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 194 of file QuantizeWithPredecessorPass.cpp.

195{
196 bool changed = false;
197
198 LOGGER(l);
199
200 for (auto node : loco::active_nodes(loco::output_nodes(g)))
201 {
202 auto circle_node = loco::must_cast<luci::CircleNode *>(node);
203 INFO(l) << "QuantizeWithPredecessorPass visit node: " << circle_node->name() << std::endl;
204
205 QuantizeWithPredecessor qwp;
206 if (circle_node->accept(&qwp))
207 {
208 changed = true;
209 }
210 }
211
212 return changed;
213}
#define LOGGER(name)
Definition Log.h:65
#define INFO(name)
Definition Log.h:68
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(), INFO, LOGGER, and loco::output_nodes().

Referenced by package.infer.session::inference(), and luci::QuantizeOnnxFakeQuantModelPass::run().


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