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

Class to substitute certain SplitV to Split. More...

#include <SubstituteSplitVToSplitPass.h>

Collaboration diagram for luci::SubstituteSplitVToSplitPass:

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 substitute certain SplitV to Split.

Definition at line 28 of file SubstituteSplitVToSplitPass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 30 of file SubstituteSplitVToSplitPass.h.

30{ return "luci::SubstituteSplitVToSplitPass"; }

◆ run()

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

EXAMPLE (SplitV with num_split = 2)

BEFORE [CircleNode] | [CircleSplitV] (size_splits and split_dim are ignored) / \ [CircleSplitVOut] [CircleSplitVOut] | | [CircleNode] [CircleNode]

AFTER [CircleNode] / \ [CircleSplit] [CircleSplitV] (dead) / \ \ [CircleSplitOut] [CircleSplitOut] [CircleSplitVOut] * 2 (dead) | | [CircleNode] [CircleNode]

Implements logo::Pass.

Definition at line 107 of file SubstituteSplitVToSplitPass.cpp.

108{
109 bool changed = false;
110 for (auto node : loco::active_nodes(loco::output_nodes(g)))
111 {
112 if (auto sv = dynamic_cast<luci::CircleSplitV *>(node))
113 {
114 if (resolve_splitv(sv))
115 changed = true;
116 }
117 }
118
119 return changed;
120}
SPLIT_V 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: