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

fuse or remove subsequent Transpose operators More...

#include <RemoveRedundantTransposePass.h>

Collaboration diagram for luci::RemoveRedundantTransposePass:

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

fuse or remove subsequent Transpose operators

Definition at line 28 of file RemoveRedundantTransposePass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 30 of file RemoveRedundantTransposePass.h.

30{ return "luci::RemoveRedundantTransposePass"; }

◆ run()

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

BEFORE | [CircleNode] [CircleConst] | (pred_perm) \ / [CircleTranspose] [CircleConst] (pred_node) (target_perm) \ / [CircleTranspose] (target_node) |

AFTER | | [CircleNode] [CircleConst](new) | \ / or [CircleNode] [CircleTranspose](new) | | |

Implements logo::Pass.

Definition at line 116 of file RemoveRedundantTransposePass.cpp.

117{
118 bool changed = false;
119 for (auto node : loco::active_nodes(loco::output_nodes(g)))
120 {
121 if (auto transpose = dynamic_cast<luci::CircleTranspose *>(node))
122 {
123 if (remove_consecutive_transpose_function(transpose))
124 changed = true;
125 }
126 }
127 return changed;
128}
TRANSPOSE 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: