Compute Library
 21.02
DotGraphVisitor Class Referencefinal

Graph printer visitor. More...

#include <DotGraphPrinter.h>

Collaboration diagram for DotGraphVisitor:
[legend]

Public Member Functions

 DotGraphVisitor ()=default
 Default Constructor. More...
 
const std::string & info () const
 Returns the output information of the last visited node. More...
 
void visit (ActivationLayerNode &n) override
 Visit ActivationLayerNode. More...
 
void visit (BatchNormalizationLayerNode &n) override
 Visit BatchNormalizationLayerNode. More...
 
void visit (ConcatenateLayerNode &n) override
 Visit ConcatenateLayerNode. More...
 
void visit (ConvolutionLayerNode &n) override
 Visit ConvolutionLayerNode. More...
 
void visit (DepthwiseConvolutionLayerNode &n) override
 Visit DepthwiseConvolutionLayerNode. More...
 
void visit (EltwiseLayerNode &n) override
 Visit EltwiseLayerNode. More...
 
void visit (FusedConvolutionBatchNormalizationNode &n) override
 Visit FusedConvolutionBatchNormalizationNode. More...
 
void visit (FusedDepthwiseConvolutionBatchNormalizationNode &n) override
 Visit FusedDepthwiseConvolutionBatchNormalizationNode. More...
 
void visit (NormalizationLayerNode &n) override
 Visit NormalizationLayerNode. More...
 
void visit (PoolingLayerNode &n) override
 Visit PoolingLayerNode. More...
 
void default_visit () override
 Function to be overloaded by the client and implement default behavior for the non-overloaded visitors. More...
 
- Public Member Functions inherited from DefaultNodeVisitor
virtual ~DefaultNodeVisitor ()=default
 Default destructor. More...
 
- Public Member Functions inherited from INodeVisitor
virtual ~INodeVisitor ()=default
 Default destructor. More...
 
virtual void visit (INode &n)=0
 Visit INode. More...
 
virtual void visit (ConstNode &n)=0
 Visit ConstNode. More...
 
virtual void visit (DequantizationLayerNode &n)=0
 Visit DequantizationLayerNode. More...
 
virtual void visit (DetectionOutputLayerNode &n)=0
 Visit DetectionOutputLayerNode. More...
 
virtual void visit (DetectionPostProcessLayerNode &n)=0
 Visit DetectionPostProcessLayerNode. More...
 
virtual void visit (FlattenLayerNode &n)=0
 Visit FlattenLayerNode. More...
 
virtual void visit (FullyConnectedLayerNode &n)=0
 Visit FullyConnectedLayerNode. More...
 
virtual void visit (InputNode &n)=0
 Visit InputNode. More...
 
virtual void visit (OutputNode &n)=0
 Visit OutputNode. More...
 
virtual void visit (PermuteLayerNode &n)=0
 Visit PermuteLayerNode. More...
 
virtual void visit (PReluLayerNode &n)=0
 Visit PreluLayerNode. More...
 
virtual void visit (PrintLayerNode &n)=0
 Visit PrintLayerNode. More...
 
virtual void visit (PriorBoxLayerNode &n)=0
 Visit PriorBoxLayerNode. More...
 
virtual void visit (QuantizationLayerNode &n)=0
 Visit QuantizationLayerNode. More...
 
virtual void visit (ReshapeLayerNode &n)=0
 Visit ReshapeLayerNode. More...
 
virtual void visit (SoftmaxLayerNode &n)=0
 Visit SoftmaxLayerNode. More...
 
virtual void visit (SplitLayerNode &n)=0
 Visit SplitLayerNode. More...
 
virtual void visit (StackLayerNode &n)=0
 Visit StackLayerNode. More...
 

Detailed Description

Graph printer visitor.

Definition at line 38 of file DotGraphPrinter.h.

Constructor & Destructor Documentation

◆ DotGraphVisitor()

DotGraphVisitor ( )
default

Default Constructor.

Member Function Documentation

◆ default_visit()

void default_visit ( )
overridevirtual

Function to be overloaded by the client and implement default behavior for the non-overloaded visitors.

Implements DefaultNodeVisitor.

Definition at line 114 of file DotGraphPrinter.cpp.

115 {
116  _info.clear();
117 }

◆ info()

const std::string & info ( ) const

Returns the output information of the last visited node.

Returns
Information of the last visited node

Definition at line 119 of file DotGraphPrinter.cpp.

120 {
121  return _info;
122 }

◆ visit() [1/10]

void visit ( ActivationLayerNode n)
overridevirtual

Visit ActivationLayerNode.

Parameters
[in]nNode to visit.

Implements INodeVisitor.

Definition at line 36 of file DotGraphPrinter.cpp.

References ActivationLayerInfo::activation(), ActivationLayerNode::activation_info(), and arm_compute::test::validation::ss().

37 {
38  std::stringstream ss;
39  ss << n.activation_info().activation();
40  _info = ss.str();
41 }
std::stringstream ss(mlgo_str)

◆ visit() [2/10]

void visit ( BatchNormalizationLayerNode n)
overridevirtual

Visit BatchNormalizationLayerNode.

Parameters
[in]nNode to visit.

Implements INodeVisitor.

Definition at line 43 of file DotGraphPrinter.cpp.

References ActivationLayerInfo::activation(), ActivationLayerInfo::enabled(), BatchNormalizationLayerNode::fused_activation(), arm_compute::test::validation::ss(), and arm_compute::to_string().

44 {
45  std::stringstream ss;
46  ss << (n.fused_activation().enabled() ? to_string(n.fused_activation().activation()) : "");
47  _info = ss.str();
48 }
std::stringstream ss(mlgo_str)
std::string to_string(const ICLTensor &arg)

◆ visit() [3/10]

void visit ( ConcatenateLayerNode n)
overridevirtual

Visit ConcatenateLayerNode.

Parameters
[in]nNode to visit.

Implements INodeVisitor.

Definition at line 50 of file DotGraphPrinter.cpp.

References ConcatenateLayerNode::concatenation_axis(), ConcatenateLayerNode::is_enabled(), and arm_compute::test::validation::ss().

51 {
52  std::stringstream ss;
53  ss << "Enabled: " << n.is_enabled();
54  ss << R"( \n )";
55  ss << "Axis: " << n.concatenation_axis();
56  _info = ss.str();
57 }
std::stringstream ss(mlgo_str)

◆ visit() [4/10]

void visit ( ConvolutionLayerNode n)
overridevirtual

Visit ConvolutionLayerNode.

Parameters
[in]nNode to visit.

Implements INodeVisitor.

Definition at line 59 of file DotGraphPrinter.cpp.

References ConvolutionLayerNode::convolution_method(), and arm_compute::test::validation::ss().

60 {
61  std::stringstream ss;
62  ss << n.convolution_method();
63  _info = ss.str();
64 }
std::stringstream ss(mlgo_str)

◆ visit() [5/10]

void visit ( DepthwiseConvolutionLayerNode n)
overridevirtual

Visit DepthwiseConvolutionLayerNode.

Parameters
[in]nNode to visit.

Implements INodeVisitor.

Definition at line 66 of file DotGraphPrinter.cpp.

References DepthwiseConvolutionLayerNode::depthwise_convolution_method(), and arm_compute::test::validation::ss().

67 {
68  std::stringstream ss;
69  ss << n.depthwise_convolution_method();
70  _info = ss.str();
71 }
std::stringstream ss(mlgo_str)

◆ visit() [6/10]

void visit ( EltwiseLayerNode n)
overridevirtual

Visit EltwiseLayerNode.

Parameters
[in]nNode to visit.

Implements INodeVisitor.

Definition at line 73 of file DotGraphPrinter.cpp.

References EltwiseLayerNode::eltwise_operation(), and arm_compute::test::validation::ss().

74 {
75  std::stringstream ss;
76  ss << n.eltwise_operation();
77  _info = ss.str();
78 }
std::stringstream ss(mlgo_str)

◆ visit() [7/10]

void visit ( FusedConvolutionBatchNormalizationNode n)
overridevirtual

Visit FusedConvolutionBatchNormalizationNode.

Parameters
[in]nNode to visit.

Implements INodeVisitor.

Definition at line 80 of file DotGraphPrinter.cpp.

References ARM_COMPUTE_UNUSED, and arm_compute::test::validation::ss().

81 {
83  std::stringstream ss;
84  ss << "FusedConvolutionBatchNormalizationNode";
85  _info = ss.str();
86 }
std::stringstream ss(mlgo_str)
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152

◆ visit() [8/10]

void visit ( FusedDepthwiseConvolutionBatchNormalizationNode n)
overridevirtual

Visit FusedDepthwiseConvolutionBatchNormalizationNode.

Parameters
[in]nNode to visit.

Implements INodeVisitor.

Definition at line 88 of file DotGraphPrinter.cpp.

References ARM_COMPUTE_UNUSED, and arm_compute::test::validation::ss().

89 {
91  std::stringstream ss;
92  ss << "FusedDepthwiseConvolutionBatchNormalizationNode";
93  _info = ss.str();
94 }
std::stringstream ss(mlgo_str)
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152

◆ visit() [9/10]

void visit ( NormalizationLayerNode n)
overridevirtual

Visit NormalizationLayerNode.

Parameters
[in]nNode to visit.

Implements INodeVisitor.

Definition at line 96 of file DotGraphPrinter.cpp.

References NormalizationLayerNode::normalization_info(), arm_compute::test::validation::ss(), and NormalizationLayerInfo::type().

97 {
98  std::stringstream ss;
99  ss << n.normalization_info().type();
100  _info = ss.str();
101 }
std::stringstream ss(mlgo_str)

◆ visit() [10/10]

void visit ( PoolingLayerNode n)
overridevirtual

Visit PoolingLayerNode.

Parameters
[in]nNode to visit.

Implements INodeVisitor.

Definition at line 103 of file DotGraphPrinter.cpp.

References PoolingLayerInfo::pad_stride_info, PoolingLayerInfo::pool_size, PoolingLayerInfo::pool_type, PoolingLayerNode::pooling_info(), and arm_compute::test::validation::ss().

104 {
105  std::stringstream ss;
106  ss << n.pooling_info().pool_type;
107  ss << R"( \n )";
108  ss << n.pooling_info().pool_size;
109  ss << R"( \n )";
110  ss << n.pooling_info().pad_stride_info;
111  _info = ss.str();
112 }
std::stringstream ss(mlgo_str)

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