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

Pass to fuse CircleCustom(PostScale) to succeeding Ops. More...

#include <FusePostScalePass.h>

Collaboration diagram for fme_apply::FusePostScalePass:

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(PostScale) to succeeding Ops.

BEFORE

    [Node]
      |
  [PostScale]

AFTER

   [Node'] (Weights are updated)

Definition at line 41 of file FusePostScalePass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 44 of file FusePostScalePass.h.

44{ return "fme::FusePostScalePass"; }

◆ run()

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

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 507 of file FusePostScalePass.cpp.

508{
509 bool changed = false;
510 for (auto node : loco::active_nodes(loco::output_nodes(g)))
511 {
512 FusePostScale fps;
513 auto cnode = loco::must_cast<luci::CircleNode *>(node);
514 if (cnode->accept(&fps))
515 changed = true;
516 }
517 return changed;
518}
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: