ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
luci::RemoveRedundantQuantizePass Struct Referencefinal

Class to remove redundant quantize operations. More...

#include <RemoveRedundantQuantizePass.h>

Collaboration diagram for luci::RemoveRedundantQuantizePass:

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 remove redundant quantize operations.

Definition at line 28 of file RemoveRedundantQuantizePass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 30 of file RemoveRedundantQuantizePass.h.

30{ return "luci::RemoveRedundantQuantizePass"; }

◆ run()

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

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 90 of file RemoveRedundantQuantizePass.cpp.

91{
92 bool changed = false;
93 for (auto node : loco::postorder_traversal(loco::output_nodes(g)))
94 {
95 if (auto quantize_node = dynamic_cast<luci::CircleQuantize *>(node))
96 {
97 if (remove_redundant_subsequent_quantize(quantize_node))
98 changed = true;
99 }
100 }
101 return changed;
102}
QUANTIZE in Circle.
std::vector< loco::Node * > postorder_traversal(const std::vector< loco::Node * > &roots)
Generate postorder traversal sequence starting from "roots".
Definition Algorithm.cpp:53
std::vector< Node * > output_nodes(Graph *)
Definition Graph.cpp:101

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


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