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

Decompose TFSquaredDifference to TFSub, TFMul. More...

#include <ResolveSquaredDifference.h>

Collaboration diagram for moco::ResolveSquaredDifference:

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

Decompose TFSquaredDifference to TFSub, TFMul.

Definition at line 30 of file ResolveSquaredDifference.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 33 of file ResolveSquaredDifference.h.

33{ return "ResolveSquaredDifference"; }

◆ run()

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

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 74 of file ResolveSquaredDifference.cpp.

75{
77 bool changed = false;
78
79 for (auto node : active_nodes)
80 {
81 if (node->dialect() == TFDialect::get())
82 {
83 auto tf_node = dynamic_cast<moco::TFSquaredDifference *>(node);
84 if (tf_node != nullptr)
85 {
86 if (decompose_sqdiff(tf_node))
87 changed = true;
88 }
89 }
90 }
91
92 return changed;
93}
static loco::Dialect * get(void)
Definition TFDialect.cpp:84
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(), moco::TFNode::dialect(), moco::TFDialect::get(), and loco::output_nodes().

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


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