ONE - On-device Neural Engine
Loading...
Searching...
No Matches
OpPrinter Struct Referencefinal
Collaboration diagram for OpPrinter:

Public Member Functions

 OpPrinter (std::ostream &os, int indent)
 
void visit (const coco::Load *op) override
 
void visit (const coco::PadF *op) override
 
void visit (const coco::Conv2D *op) override
 
void visit (const coco::MaxPool2D *op) override
 
void visit (const coco::AvgPool2D *op) override
 
void visit (const coco::Add *op) override
 
void visit (const coco::Mul *op) override
 
void visit (const coco::ReLU *op) override
 
void visit (const coco::ReLU6 *op) override
 
void visit (const coco::Sub *op) override
 
void visit (const coco::ConcatF *op) override
 
void visit (const coco::Div *op) override
 
- Public Member Functions inherited from coco::Op::Visitor< T >
virtual ~Visitor ()=default
 
- Public Member Functions inherited from coco::Op::IVisitor< T >
virtual ~IVisitor ()=default
 

Detailed Description

Definition at line 40 of file Dump.cpp.

Constructor & Destructor Documentation

◆ OpPrinter()

OpPrinter::OpPrinter ( std::ostream &  os,
int  indent 
)
inline

Definition at line 43 of file Dump.cpp.

43: _os(os), _indent(indent) {}

Member Function Documentation

◆ visit() [1/12]

void OpPrinter::visit ( const coco::Add op)
inlineoverride

Definition at line 83 of file Dump.cpp.

84 {
85 op->left()->accept(this);
86 op->right()->accept(this);
87 _os << tab(_indent) << "Add" << std::endl;
88 }
Op * right(void) const
Definition Op.h:236
Op * left(void) const
Definition Op.h:232
std::string tab(int n)
Definition Dump.cpp:38
T accept(IVisitor< T > *v) const
Definition Op.h:101

References coco::Op::accept(), coco::BinaryOp::left(), coco::BinaryOp::right(), and tab().

◆ visit() [2/12]

void OpPrinter::visit ( const coco::AvgPool2D op)
inlineoverride

Definition at line 77 of file Dump.cpp.

78 {
79 op->arg()->accept(this);
80 _os << tab(_indent) << "AvgPool2D" << std::endl;
81 }
Op * arg(uint32_t n) const final
Return N-th argument.

References coco::Op::accept(), coco::UnaryOp::arg(), and tab().

◆ visit() [3/12]

void OpPrinter::visit ( const coco::ConcatF op)
inlineoverride

Definition at line 116 of file Dump.cpp.

117 {
118 op->left()->accept(this);
119 op->right()->accept(this);
120 _os << tab(_indent) << "ConcatF" << std::endl;
121 }

References coco::Op::accept(), coco::BinaryOp::left(), coco::BinaryOp::right(), and tab().

◆ visit() [4/12]

void OpPrinter::visit ( const coco::Conv2D op)
inlineoverride

Definition at line 58 of file Dump.cpp.

59 {
60 op->arg()->accept(this);
61 const coco::Padding2D *pad = op->pad();
62 const coco::Stride2D *stride = op->stride();
63
64 _os << tab(_indent) << "Conv2D(" << dynamic_cast<const coco::Op *>(op)
65 << ", ker obj: " << op->ker() << ", padding [T/B/L/R=" << pad->top() << "," << pad->bottom()
66 << "," << pad->left() << "," << pad->right() << "]"
67 << ", stride [V/H = " << stride->vertical() << "," << stride->horizontal() << "]"
68 << ")" << std::endl;
69 }
Padding2D * pad(void)
Definition Ops.h:120
KernelObject * ker(void) const
Definition Conv2D.cpp:64
Stride2D * stride(void)
Definition Ops.h:124
Op * arg(uint32_t n) const final
Return N-th argument.
uint32_t left(void) const
Definition Padding2D.h:49
uint32_t right(void) const
Definition Padding2D.h:53
uint32_t top(void) const
Definition Padding2D.h:41
uint32_t bottom(void) const
Definition Padding2D.h:45
uint32_t vertical(void) const
Definition Stride2D.h:40
uint32_t horizontal(void) const
Definition Stride2D.h:44
Base interface on all supported NN operations.
Definition Op.h:45

References coco::Op::accept(), coco::Conv2D::arg(), coco::Padding2D::bottom(), coco::Stride2D::horizontal(), coco::Conv2D::ker(), coco::Padding2D::left(), coco::Conv2D::pad(), coco::Padding2D::right(), coco::Conv2D::stride(), tab(), coco::Padding2D::top(), and coco::Stride2D::vertical().

◆ visit() [5/12]

void OpPrinter::visit ( const coco::Div op)
inlineoverride

Definition at line 123 of file Dump.cpp.

124 {
125 op->left()->accept(this);
126 op->right()->accept(this);
127 _os << tab(_indent) << "Div" << std::endl;
128 }

References coco::Op::accept(), coco::BinaryOp::left(), coco::BinaryOp::right(), and tab().

◆ visit() [6/12]

void OpPrinter::visit ( const coco::Load op)
inlineoverride

Definition at line 46 of file Dump.cpp.

47 {
48 _os << tab(_indent) << "Load(" << dynamic_cast<const coco::Op *>(op)
49 << ", obj: " << op->object() << ")" << std::endl;
50 }
void object(Object *o)
Definition Ops.h:60

References coco::Load::object(), and tab().

◆ visit() [7/12]

void OpPrinter::visit ( const coco::MaxPool2D op)
inlineoverride

Definition at line 71 of file Dump.cpp.

72 {
73 op->arg()->accept(this);
74 _os << tab(_indent) << "MaxPool2D" << std::endl;
75 }

References coco::Op::accept(), coco::UnaryOp::arg(), and tab().

◆ visit() [8/12]

void OpPrinter::visit ( const coco::Mul op)
inlineoverride

Definition at line 90 of file Dump.cpp.

91 {
92 op->left()->accept(this);
93 op->right()->accept(this);
94 _os << tab(_indent) << "Mul" << std::endl;
95 }

References coco::Op::accept(), coco::BinaryOp::left(), coco::BinaryOp::right(), and tab().

◆ visit() [9/12]

void OpPrinter::visit ( const coco::PadF op)
inlineoverride

Definition at line 52 of file Dump.cpp.

53 {
54 op->arg()->accept(this);
55 _os << tab(_indent) << "PadF" << std::endl;
56 }

References coco::Op::accept(), coco::UnaryOp::arg(), and tab().

◆ visit() [10/12]

void OpPrinter::visit ( const coco::ReLU op)
inlineoverride

Definition at line 97 of file Dump.cpp.

98 {
99 op->arg()->accept(this);
100 _os << tab(_indent) << "ReLU" << std::endl;
101 }

References coco::Op::accept(), coco::UnaryOp::arg(), and tab().

◆ visit() [11/12]

void OpPrinter::visit ( const coco::ReLU6 op)
inlineoverride

Definition at line 103 of file Dump.cpp.

104 {
105 op->arg()->accept(this);
106 _os << tab(_indent) << "ReLU6" << std::endl;
107 }

References coco::Op::accept(), coco::UnaryOp::arg(), and tab().

◆ visit() [12/12]

void OpPrinter::visit ( const coco::Sub op)
inlineoverride

Definition at line 109 of file Dump.cpp.

110 {
111 op->left()->accept(this);
112 op->right()->accept(this);
113 _os << tab(_indent) << "Sub" << std::endl;
114 }

References coco::Op::accept(), coco::BinaryOp::left(), coco::BinaryOp::right(), and tab().


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