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

Class to Fold Densify if input is Sparse Constant. More...

#include <FoldDensifyPass.h>

Collaboration diagram for luci::FoldDensifyPass:

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 Fold Densify if input is Sparse Constant.

Definition at line 29 of file FoldDensifyPass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 31 of file FoldDensifyPass.h.

31{ return "luci::FoldDensifyPass"; }

◆ run()

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

BEFORE

[CircleConst](sparse) | [CircleDensify] | [CircleNode] |

AFTER

[CircleConst](dense) [CircleConst](sparse) | | [CircleNode] [CircleDensify] |

Implements logo::Pass.

Definition at line 164 of file FoldDensifyPass.cpp.

165{
166 bool changed = false;
167
168 for (auto node : loco::active_nodes(loco::output_nodes(g)))
169 {
170 if (auto densify = dynamic_cast<luci::CircleDensify *>(node))
171 {
172 if (fold_densify(densify))
173 changed = true;
174 }
175 }
176
177 return changed;
178}
DENSIFY 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: