ArmNN
 24.08
SerializeLayerParameters.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017,2022-2023 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include <string>
8 #include <functional>
9 #include <armnn/Descriptors.hpp>
10 
11 namespace armnn
12 {
13 
14 using ParameterStringifyFunction = std::function<void(const std::string& name, const std::string& value)>;
15 
16 ///
17 /// StringifyLayerParameters allows serializing layer parameters to string.
18 /// The default implementation is a no-op because this operation is considered
19 /// non-vital for ArmNN and thus we allow adding new layer parameters without
20 /// supplying the corresponding stringify functionality.
21 ///
22 template <typename LayerParameter>
24 {
25  static void Serialize(ParameterStringifyFunction&, const LayerParameter&) {}
26 };
27 
29 {
30  static void Serialize(ParameterStringifyFunction& fn, const ActivationDescriptor& desc);
31 };
32 
34 {
36 };
37 
39 {
40  static void Serialize(ParameterStringifyFunction& fn, const BatchMatMulDescriptor& desc);
41 };
42 
44 {
46 };
47 
49 {
51 };
52 
54 {
55  static void Serialize(ParameterStringifyFunction& fn, const ComparisonDescriptor& desc);
56 };
57 
59 {
60  static void Serialize(ParameterStringifyFunction& fn, const Convolution2dDescriptor& desc);
61 };
62 
64 {
65  static void Serialize(ParameterStringifyFunction& fn, const Convolution3dDescriptor& desc);
66 };
67 
69 {
71 };
72 
74 {
76 };
77 
79 {
81 };
82 
84 {
86 };
87 
89 {
91 };
92 
94 {
96 };
97 
99 {
100  static void Serialize(ParameterStringifyFunction& fn, const GatherDescriptor& desc);
101 };
102 
104 {
105  static void Serialize(ParameterStringifyFunction& fn, const L2NormalizationDescriptor& desc);
106 };
107 
109 {
110  static void Serialize(ParameterStringifyFunction& fn, const LstmDescriptor& desc);
111 };
112 
114 {
115  static void Serialize(ParameterStringifyFunction& fn, const MeanDescriptor& desc);
116 };
117 
119 {
120  static void Serialize(ParameterStringifyFunction& fn, const NormalizationDescriptor& desc);
121 };
122 
124 {
125  static void Serialize(ParameterStringifyFunction& fn, const OriginsDescriptor& desc);
126 };
127 
129 {
130  static void Serialize(ParameterStringifyFunction& fn, const PadDescriptor& desc);
131 };
133 {
134  static void Serialize(ParameterStringifyFunction& fn, const PermuteDescriptor& desc);
135 };
136 
138 {
139  static void Serialize(ParameterStringifyFunction& fn, const Pooling2dDescriptor& desc);
140 };
141 
143 {
144  static void Serialize(ParameterStringifyFunction& fn, const Pooling3dDescriptor& desc);
145 };
146 
148 {
149  static void Serialize(ParameterStringifyFunction& fn, const PreCompiledDescriptor& desc);
150 };
151 
153 {
154  static void Serialize(ParameterStringifyFunction& fn, const FusedDescriptor& desc);
155 };
156 
158 {
159  static void Serialize(ParameterStringifyFunction& fn, const ReduceDescriptor& desc);
160 };
161 
163 {
164  static void Serialize(ParameterStringifyFunction& fn, const ReshapeDescriptor& desc);
165 };
166 
168 {
169  static void Serialize(ParameterStringifyFunction& fn, const ResizeDescriptor& desc);
170 };
171 
173 {
174  static void Serialize(ParameterStringifyFunction& fn, const SpaceToBatchNdDescriptor& desc);
175 };
176 
178 {
179  static void Serialize(ParameterStringifyFunction& fn, const SpaceToDepthDescriptor& desc);
180 };
181 
183 {
184  static void Serialize(ParameterStringifyFunction& fn, const StackDescriptor& desc);
185 };
186 
188 {
189  static void Serialize(ParameterStringifyFunction& fn, const StridedSliceDescriptor& desc);
190 };
191 
193 {
194  static void Serialize(ParameterStringifyFunction& fn, const SoftmaxDescriptor& desc);
195 };
196 
198 {
199  static void Serialize(ParameterStringifyFunction& fn, const TileDescriptor& desc);
200 };
201 
203 {
205 };
206 
208 {
209  static void Serialize(ParameterStringifyFunction& fn, const TransposeDescriptor& desc);
210 };
211 
213 {
214  static void Serialize(ParameterStringifyFunction& fn, const ViewsDescriptor& desc);
215 };
216 
217 } // namespace armnn
armnn::BatchNormalizationDescriptor
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
Definition: Descriptors.hpp:828
armnn::ViewsDescriptor
A ViewsDescriptor for the SplitterLayer.
Definition: Descriptors.hpp:244
armnn::ActivationDescriptor
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:36
armnn::FullyConnectedDescriptor
A FullyConnectedDescriptor for the FullyConnectedLayer.
Definition: Descriptors.hpp:507
Descriptors.hpp
armnn::Pooling3dDescriptor
A Pooling3dDescriptor for the Pooling3dLayer.
Definition: Descriptors.hpp:431
armnn::ResizeDescriptor
A ResizeDescriptor for the ResizeLayer.
Definition: Descriptors.hpp:985
armnn::GatherDescriptor
A GatherDescriptor for the GatherLayer.
Definition: Descriptors.hpp:965
armnn::L2NormalizationDescriptor
A L2NormalizationDescriptor for the L2NormalizationLayer.
Definition: Descriptors.hpp:809
armnn::NormalizationDescriptor
A NormalizationDescriptor for the NormalizationLayer.
Definition: Descriptors.hpp:769
armnn::ChannelShuffleDescriptor
A ChannelShuffleDescriptor for the ChannelShuffle operator.
Definition: Descriptors.hpp:1562
armnn::StackDescriptor
A StackDescriptor for the StackLayer.
Definition: Descriptors.hpp:1251
armnn::ElementwiseBinaryDescriptor
A ElementwiseBinaryDescriptor for the ElementwiseBinaryLayer.
Definition: Descriptors.hpp:109
armnn::FusedDescriptor
A FusedDescriptor for the FusedLayer.
Definition: Descriptors.hpp:944
armnn::PadDescriptor
A PadDescriptor for the PadLayer.
Definition: Descriptors.hpp:1196
armnn::TransposeDescriptor
A TransposeDescriptor for the TransposeLayer.
Definition: Descriptors.hpp:1490
armnn::ReshapeDescriptor
A ReshapeDescriptor for the ReshapeLayer.
Definition: Descriptors.hpp:1023
armnn::ParameterStringifyFunction
std::function< void(const std::string &name, const std::string &value)> ParameterStringifyFunction
Definition: SerializeLayerParameters.hpp:14
armnn::PermuteDescriptor
A PermuteDescriptor for the PermuteLayer.
Definition: Descriptors.hpp:149
armnn::BatchMatMulDescriptor
A BatchMatMulDescriptor for the BatchMatMul operator.
Definition: Descriptors.hpp:1584
armnn::SpaceToBatchNdDescriptor
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
Definition: Descriptors.hpp:1043
armnn::StringifyLayerParameters::Serialize
static void Serialize(ParameterStringifyFunction &, const LayerParameter &)
Definition: SerializeLayerParameters.hpp:25
armnn::Convolution3dDescriptor
A Convolution3dDescriptor for the Convolution3dLayer.
Definition: Descriptors.hpp:588
armnn::StringifyLayerParameters
StringifyLayerParameters allows serializing layer parameters to string.
Definition: SerializeLayerParameters.hpp:23
armnn::BatchToSpaceNdDescriptor
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
Definition: Descriptors.hpp:875
armnn::Convolution2dDescriptor
A Convolution2dDescriptor for the Convolution2dLayer.
Definition: Descriptors.hpp:534
armnn::ComparisonDescriptor
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:89
armnn::LstmDescriptor
An LstmDescriptor for the LstmLayer.
Definition: Descriptors.hpp:1102
armnn::StridedSliceDescriptor
A StridedSliceDescriptor for the StridedSliceLayer.
Definition: Descriptors.hpp:1303
armnn::OriginsDescriptor
An OriginsDescriptor for the ConcatLayer.
Definition: Descriptors.hpp:201
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::ElementwiseUnaryDescriptor
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
Definition: Descriptors.hpp:129
armnn::TransposeConvolution2dDescriptor
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
Definition: Descriptors.hpp:1440
armnn::DetectionPostProcessDescriptor
Definition: Descriptors.hpp:713
armnn::PreCompiledDescriptor
A PreCompiledDescriptor for the PreCompiledLayer.
Definition: Descriptors.hpp:1367
armnn::Pooling2dDescriptor
A Pooling2dDescriptor for the Pooling2dLayer.
Definition: Descriptors.hpp:371
armnn::DepthwiseConvolution2dDescriptor
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
Definition: Descriptors.hpp:659
armnn::ReduceDescriptor
A ReduceDescriptor for the REDUCE operators.
Definition: Descriptors.hpp:1538
armnn::FakeQuantizationDescriptor
A FakeQuantizationDescriptor for the FakeQuantizationLayer.
Definition: Descriptors.hpp:906
armnn::MeanDescriptor
A MeanDescriptor for the MeanLayer.
Definition: Descriptors.hpp:1172
armnn::TileDescriptor
Definition: Descriptors.hpp:1640
armnn::SoftmaxDescriptor
A SoftmaxDescriptor for the SoftmaxLayer.
Definition: Descriptors.hpp:177
armnn::SpaceToDepthDescriptor
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
Definition: Descriptors.hpp:1075