ONE - On-device Neural Engine
Loading...
Searching...
No Matches
moco::tf::SimpleNodeTransform< ConcreteNode > Struct Template Referenceabstract

Per-Node Transform. More...

#include <SimpleNodeTransform.h>

Collaboration diagram for moco::tf::SimpleNodeTransform< ConcreteNode >:

Public Member Functions

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

Detailed Description

template<typename ConcreteNode>
struct moco::tf::SimpleNodeTransform< ConcreteNode >

Per-Node Transform.

Definition at line 30 of file SimpleNodeTransform.h.

Constructor & Destructor Documentation

◆ SimpleNodeTransform()

template<typename ConcreteNode >
moco::tf::SimpleNodeTransform< ConcreteNode >::SimpleNodeTransform ( )
default

◆ ~SimpleNodeTransform()

template<typename ConcreteNode >
virtual moco::tf::SimpleNodeTransform< ConcreteNode >::~SimpleNodeTransform ( )
virtualdefault

Member Function Documentation

◆ run()

template<typename ConcreteNode >
bool moco::tf::SimpleNodeTransform< ConcreteNode >::run ( loco::Graph graph)
inlinefinalvirtual

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 39 of file SimpleNodeTransform.h.

40 {
43
44 bool changed = false;
45
46 for (auto node : active_nodes(output_nodes(graph)))
47 {
48 if (auto casted = dynamic_cast<ConcreteNode *>(node))
49 {
50 if (transform(casted))
51 {
52 changed = true;
53 }
54 }
55 }
56
57 return changed;
58 }
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
virtual bool transform(ConcreteNode *node) const =0

References loco::active_nodes(), loco::output_nodes(), and moco::tf::SimpleNodeTransform< ConcreteNode >::transform().

Referenced by package.infer.session::inference().

◆ transform()


The documentation for this struct was generated from the following file: