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

Class to substitute Strided_Slice with certain condition to single reshape node. More...

#include <SubstituteStridedSliceToReshapePass.h>

Collaboration diagram for luci::SubstituteStridedSliceToReshapePass:

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 Strided_Slice with certain condition to single reshape node.

Definition at line 28 of file SubstituteStridedSliceToReshapePass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 30 of file SubstituteStridedSliceToReshapePass.h.

30{ return "luci::SubstituteStridedSliceToReshapePass"; }

◆ run()

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

BEFORE | [CircleNode] [CircleConst] [CircleConst] [CircleConst] | | | | ----—+---------------------------------— | [CircleStridedSlice] | [CircleNode] | AFTER | [CircleConst] [CircleNode] [CircleConst] [CircleConst] [CircleConst] \ / \ | | | [CircleReshape] ----------------—+-------------------— | | [CircleNode] [CircleStridedSlice] |

Implements logo::Pass.

Definition at line 199 of file SubstituteStridedSliceToReshapePass.cpp.

200{
201 bool changed = false;
202 for (auto node : loco::active_nodes(loco::output_nodes(g)))
203 {
204 if (auto circle_node = dynamic_cast<luci::CircleStridedSlice *>(node))
205 {
206 if (substitute_strided_slice_to_reshape(circle_node))
207 {
208 changed = true;
209 }
210 }
211 }
212 return changed;
213}
STRIDED_SLICE 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: