ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnc::LowerConv2D Class Reference

#include <LowerConv2D.h>

Collaboration diagram for nnc::LowerConv2D:

Public Member Functions

 LowerConv2D ()
 
PassData run (PassData data) override
 run compiler pass
 
void cleanup () override
 clean compiler pass data
 
std::string getName () override
 
- Public Member Functions inherited from nnc::Pass
virtual ~Pass ()=default
 

Detailed Description

Definition at line 27 of file LowerConv2D.h.

Constructor & Destructor Documentation

◆ LowerConv2D()

nnc::LowerConv2D::LowerConv2D ( )
default

Member Function Documentation

◆ cleanup()

void nnc::LowerConv2D::cleanup ( )
overridevirtual

clean compiler pass data

Reimplemented from nnc::Pass.

Definition at line 73 of file LowerConv2D.cpp.

73{}

◆ getName()

std::string nnc::LowerConv2D::getName ( )
inlineoverridevirtual

Reimplemented from nnc::Pass.

Definition at line 36 of file LowerConv2D.h.

36{ return "LowerConv2D"; }

◆ run()

PassData nnc::LowerConv2D::run ( PassData  data)
overridevirtual

run compiler pass

Parameters
data- data that pass is taken
Returns
data that can be passed to the next pass
Exceptions
PassExceptionobject if errors occured

Implements nnc::Pass.

Definition at line 50 of file LowerConv2D.cpp.

51{
52 auto *graph = static_cast<mir::Graph *>(data);
53
54 // Collect candidate ops before actual transformation because the graph will be changed.
55 std::vector<mir::ops::Conv2DOp *> group_conv_ops;
56 for (mir::Operation *op : graph->getNodes())
57 {
58 auto *conv_op = dynamic_cast<mir::ops::Conv2DOp *>(op);
59 if (conv_op != nullptr && conv_op->getNumGroups() != 1)
60 {
61 group_conv_ops.push_back(conv_op);
62 }
63 }
64
65 for (mir::ops::Conv2DOp *op : group_conv_ops)
66 {
67 lowerConv2D(graph, op);
68 }
69
70 return graph;
71}

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


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