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

Class to convert weight format of FullyConnected to SHUFFLED16x1FLOAT32. More...

#include <ShuffleWeightTo16x1Float32Pass.h>

Collaboration diagram for luci::ShuffleWeightTo16x1Float32Pass:

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 convert weight format of FullyConnected to SHUFFLED16x1FLOAT32.

Definition at line 28 of file ShuffleWeightTo16x1Float32Pass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 30 of file ShuffleWeightTo16x1Float32Pass.h.

30{ return "luci::ShuffleWeightTo16x1Float32Pass"; }

◆ run()

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

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 118 of file ShuffleWeightTo16x1Float32Pass.cpp.

119{
120 bool changed = false;
121 for (auto node : loco::active_nodes(loco::output_nodes(g)))
122 {
123 auto fc = dynamic_cast<luci::CircleFullyConnected *>(node);
124 if (not fc)
125 continue;
126
127 if (not satisfy_precondition(fc))
128 continue;
129
130 std::vector<luci::CircleFullyConnected *> fc_vec;
131 get_FCs_having_same_tensor(fc_vec, g, fc);
132 auto new_weights = shuffle_weight(fc);
133
134 // replace to new weights
135 for (const auto fc : fc_vec)
136 {
137 fc->weights(new_weights);
139 }
140
141 changed = true;
142 }
143
144 return changed;
145}
FULLY_CONNECTED 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(), loco::output_nodes(), and luci::CircleFullyConnected::SHUFFLED16x1FLOAT32.

Referenced by package.infer.session::inference().


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