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

Class to convert a quantized model to a fake-quantized fp32 model. More...

#include <ConvertToFakeQuantizedModelPass.h>

Collaboration diagram for luci::ConvertToFakeQuantizedModelPass:

Public Member Functions

 ConvertToFakeQuantizedModelPass ()
 
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 convert a quantized model to a fake-quantized fp32 model.

Definition at line 28 of file ConvertToFakeQuantizedModelPass.h.

Constructor & Destructor Documentation

◆ ConvertToFakeQuantizedModelPass()

luci::ConvertToFakeQuantizedModelPass::ConvertToFakeQuantizedModelPass ( )
inline

Definition at line 30 of file ConvertToFakeQuantizedModelPass.h.

30{}

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 32 of file ConvertToFakeQuantizedModelPass.h.

32{ return "luci::ConvertToFakeQuantizedModelPass"; }

◆ run()

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

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 275 of file ConvertToFakeQuantizedModelPass.cpp.

276{
277 LOGGER(l);
278 for (auto node : loco::active_nodes(loco::output_nodes(g)))
279 {
280 auto circle_node = loco::must_cast<luci::CircleNode *>(node);
281 INFO(l) << "ConvertToFakeQuantizedModelPass visit node: " << circle_node->name() << std::endl;
282
283 FakeQuantize fq;
284 circle_node->accept(&fq);
285 }
286
287 // One time run
288 return false;
289}
#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().


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