ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci::ExpandBroadcastConstPass Struct Referencefinal

Class to remove broadcasts of Const nodes. More...

#include <ExpandBroadcastConstPass.h>

Collaboration diagram for luci::ExpandBroadcastConstPass:

Public Member Functions

const char * name (void) const final
 
bool run (loco::Graph *g) final
 
- Public Member Functions inherited from logo::Pass
virtual ~Pass ()=default
 

Detailed Description

Class to remove broadcasts of Const nodes.

Definition at line 28 of file ExpandBroadcastConstPass.h.

Member Function Documentation

◆ name()

const char * luci::ExpandBroadcastConstPass::name ( void  ) const
inlinefinalvirtual

Reimplemented from logo::Pass.

Definition at line 30 of file ExpandBroadcastConstPass.h.

30{ return "luci::ExpandBroadcastConstPass"; }

◆ run()

bool luci::ExpandBroadcastConstPass::run ( loco::Graph g)
finalvirtual

Broadcast expanding for Const nodes

Implements logo::Pass.

Definition at line 163 of file ExpandBroadcastConstPass.cpp.

164{
165 bool changed = false;
166 for (auto node : loco::active_nodes(loco::output_nodes(g)))
167 {
168 auto const_node = dynamic_cast<luci::CircleConst *>(node);
169 if (const_node == nullptr)
170 continue;
171
172 if (expand_broadcast_const(const_node))
173 changed = true;
174 }
175 return changed;
176}
Class to build tensor data.
Definition CircleConst.h:35
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 struct was generated from the following files: