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

Class to fold FullyConnected with constant input and filter into a constant tensor. More...

#include <FoldFullyConnectedPass.h>

Collaboration diagram for luci::FoldFullyConnectedPass:

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 FullyConnected with constant input and filter into a constant tensor.

Definition at line 29 of file FoldFullyConnectedPass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 31 of file FoldFullyConnectedPass.h.

31{ return "luci::FoldFullyConnectedPass"; }

◆ run()

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

Constant Folding for FullyConnected Op

Implements logo::Pass.

Definition at line 156 of file FoldFullyConnectedPass.cpp.

157{
158 bool changed = false;
159 for (auto node : loco::active_nodes(loco::output_nodes(g)))
160 {
161 auto fc = dynamic_cast<CircleFullyConnected *>(node);
162
163 if (fold_fully_connected(fc))
164 changed = true;
165 }
166
167 return changed;
168}
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: