ONE - On-device Neural Engine
Loading...
Searching...
No Matches
moco::SqueezeReduceNode Class Reference

If ReduceTypeOP don't keep dimensions, replace the ReduceTypeOp as new one to keep dimensions and insert TFSqueeze. More...

#include <SqueezeReduceNode.h>

Collaboration diagram for moco::SqueezeReduceNode:

Public Member Functions

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

Detailed Description

If ReduceTypeOP don't keep dimensions, replace the ReduceTypeOp as new one to keep dimensions and insert TFSqueeze.

Definition at line 31 of file SqueezeReduceNode.h.

Member Function Documentation

◆ name()

const char * moco::SqueezeReduceNode::name ( void  ) const
inlinefinalvirtual

Reimplemented from logo::Pass.

Definition at line 34 of file SqueezeReduceNode.h.

34{ return "SqueezeReduceNode"; }

◆ run()

bool moco::SqueezeReduceNode::run ( loco::Graph graph)
overridevirtual

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 89 of file SqueezeReduceNode.cpp.

90{
91 bool changed = false;
92 for (auto node : loco::active_nodes(loco::output_nodes(graph)))
93 {
94 if (auto shape_node = as<moco::TFMean>(node))
95 {
96 if (squeeze_reduce_node(graph, shape_node))
97 changed = true;
98 }
99 // TODO Add more reduce type operations
100 }
101
102 return changed;
103}
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 class was generated from the following files: