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

Replace fully determined TFShape node into TFConst. More...

#include <ResolveConstantShape.h>

Collaboration diagram for moco::ResolveConstantShape:

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

Replace fully determined TFShape node into TFConst.

Definition at line 30 of file ResolveConstantShape.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 33 of file ResolveConstantShape.h.

33{ return "ResolveConstantShape"; }

◆ run()

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

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 114 of file ResolveConstantShape.cpp.

115{
116 bool changed = false;
117 for (auto node : loco::active_nodes(loco::output_nodes(graph)))
118 {
119 if (auto shape_node = as<moco::TFShape>(node))
120 {
121 if (resolve_constant_shape(graph, shape_node))
122 changed = true;
123 }
124 }
125
126 return changed;
127}
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: