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

Class to fold DepthwiseConv2D with constant input and filter into a constant tensor. More...

#include <FoldDepthwiseConv2DPass.h>

Collaboration diagram for luci::FoldDepthwiseConv2DPass:

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 fold DepthwiseConv2D with constant input and filter into a constant tensor.

Definition at line 29 of file FoldDepthwiseConv2DPass.h.

Member Function Documentation

◆ name()

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

Reimplemented from logo::Pass.

Definition at line 31 of file FoldDepthwiseConv2DPass.h.

31{ return "luci::FoldDepthwiseConv2DPass"; }

◆ run()

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

Constant Folding for DepthwiseConv2D Op

Implements logo::Pass.

Definition at line 147 of file FoldDepthwiseConv2DPass.cpp.

148{
149 bool changed = false;
150 for (auto node : loco::active_nodes(loco::output_nodes(g)))
151 {
152 auto depthwise_conv2d = dynamic_cast<CircleDepthwiseConv2D *>(node);
153
154 if (depthwise_conv2d == nullptr)
155 continue;
156
157 switch (depthwise_conv2d->dtype())
158 {
159 case loco::DataType::FLOAT32:
160 changed = fold_depthwise_conv_2d(depthwise_conv2d);
161 break;
162 default:
163 break;
164 }
165 }
166
167 return changed;
168}
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: