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

Class to fuse Mul operation with a Div operation. More...

#include <FuseMulWithDivPass.h>

Collaboration diagram for luci::FuseMulWithDivPass:

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 fuse Mul operation with a Div operation.

Definition at line 30 of file FuseMulWithDivPass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 32 of file FuseMulWithDivPass.h.

32{ return "luci::FuseMulWithDivPass"; }

◆ run()

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

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 227 of file FuseMulWithDivPass.cpp.

228{
229 bool changed = false;
230 for (auto node : loco::active_nodes(loco::output_nodes(g)))
231 {
232 auto div = dynamic_cast<luci::CircleDiv *>(node);
233 if (not div)
234 continue;
235
236 if (fuse_mul_with_div_to_div(div))
237 changed = true;
238
239 if (fuse_mul_with_div_to_mul(div))
240 changed = true;
241 }
242
243 return changed;
244}
DIV in Circle.
Definition CircleDiv.h:37
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: