ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 197 of file ExpandBroadcastConstPass.cpp.

198{
199 bool changed = false;
200 for (auto node : loco::active_nodes(loco::output_nodes(g)))
201 {
202 auto const_node = dynamic_cast<luci::CircleConst *>(node);
203 if (const_node == nullptr)
204 continue;
205
206 if (expand_broadcast_const(const_node))
207 changed = true;
208 }
209 return changed;
210}
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().


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