ONE - On-device Neural Engine
Loading...
Searching...
No Matches
fme_apply::FusePreScalePass Class Reference

Pass to fuse CircleCustom(PreScale) to preceding Ops. More...

#include <FusePreScalePass.h>

Collaboration diagram for fme_apply::FusePreScalePass:

Public Member Functions

virtual const char * name (void) const
 
bool run (loco::Graph *graph)
 Run the pass.
 
- Public Member Functions inherited from logo::Pass
virtual ~Pass ()=default
 

Detailed Description

Pass to fuse CircleCustom(PreScale) to preceding Ops.

BEFORE

[PreScale] | [Node]

AFTER

[Node'] (Weights are updated)

Definition at line 41 of file FusePreScalePass.h.

Member Function Documentation

◆ name()

virtual const char * fme_apply::FusePreScalePass::name ( void  ) const
inlinevirtual

Reimplemented from logo::Pass.

Definition at line 44 of file FusePreScalePass.h.

44{ return "fme::FusePreScalePass"; }

◆ run()

bool fme_apply::FusePreScalePass::run ( loco::Graph graph)
virtual

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 252 of file FusePreScalePass.cpp.

253{
254 bool changed = false;
255 for (auto node : loco::active_nodes(loco::output_nodes(g)))
256 {
257 FusePreScale fps;
258 auto cnode = loco::must_cast<luci::CircleNode *>(node);
259 if (cnode->accept(&fps))
260 changed = true;
261 }
262 return changed;
263}
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().


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