ArmNN
 21.11
SerializeLayerParameters.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
6 #include <armnn/TypesUtils.hpp>
7 #include <string>
8 #include <iostream>
9 #include <sstream>
10 
11 namespace armnn
12 {
13 
15  const ActivationDescriptor& desc)
16 {
17  fn("Function", GetActivationFunctionAsCString(desc.m_Function));
18  fn("A", std::to_string(desc.m_A));
19  fn("B", std::to_string(desc.m_B));
20 }
21 
23  const BatchNormalizationDescriptor& desc)
24 {
25  fn("Eps", std::to_string(desc.m_Eps));
26  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
27 }
28 
30  const BatchToSpaceNdDescriptor& desc)
31 {
32  {
33  std::stringstream ss;
34  int count = 0;
35  for (auto&& var : desc.m_BlockShape)
36  {
37  if (count > 0)
38  {
39  ss << ",";
40  }
41  ss << var;
42  ++count;
43  }
44  fn("BlockShape", ss.str());
45  }
46 
47  {
48  std::stringstream ss;
49  int count = 0;
50  for (auto&& var : desc.m_Crops)
51  {
52  if (count > 0)
53  {
54  ss << ",";
55  }
56  ss << "[" << var.first << "," << var.second << "]";
57  ++count;
58  }
59  fn("Crops", ss.str());
60  }
61 
62  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
63 }
64 
66  const ChannelShuffleDescriptor& desc)
67 {
68  fn("Axis", std::to_string(desc.m_Axis));
69  fn("NumGroups", std::to_string(desc.m_NumGroups));
70 }
71 
73  const ComparisonDescriptor& desc)
74 {
75  fn("Operation", GetComparisonOperationAsCString(desc.m_Operation));
76 }
77 
79  const Convolution2dDescriptor& desc)
80 {
81  {
82  std::stringstream ss;
83  ss << "(" << desc.m_PadTop << "," << desc.m_PadLeft
84  << "," << desc.m_PadBottom << "," << desc.m_PadRight << ")";
85  fn("Padding(T,L,B,R)",ss.str());
86  }
87 
88  {
89  std::stringstream ss;
90  ss << "(" << desc.m_StrideX << "," << desc.m_StrideY << ")";
91  fn("Stride(X,Y)", ss.str());
92  }
93 
94  {
95  std::stringstream ss;
96  ss << "(" << desc.m_DilationX << "," << desc.m_DilationY << ")";
97  fn("Dilation(X,Y)", ss.str());
98  }
99 
100  fn("BiasEnabled",(desc.m_BiasEnabled ? "true" : "false"));
101  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
102 }
103 
105  const Convolution3dDescriptor& desc)
106 {
107  {
108  std::stringstream ss;
109  ss << "(" << desc.m_PadTop << "," << desc.m_PadLeft
110  << "," << desc.m_PadBottom << "," << desc.m_PadRight
111  << "," << desc.m_PadFront << "," << desc.m_PadBack << ")";
112  fn("Padding(T,L,B,R,F,B)",ss.str());
113  }
114 
115  {
116  std::stringstream ss;
117  ss << "(" << desc.m_StrideX << "," << desc.m_StrideY << "," << desc.m_StrideZ << ")";
118  fn("Stride(X,Y,Z)", ss.str());
119  }
120 
121  {
122  std::stringstream ss;
123  ss << "(" << desc.m_DilationX << "," << desc.m_DilationY << "," << desc.m_DilationZ << ")";
124  fn("Dilation(X,Y)", ss.str());
125  }
126 
127  fn("BiasEnabled",(desc.m_BiasEnabled ? "true" : "false"));
128  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
129 }
130 
132  const DetectionPostProcessDescriptor& desc)
133 {
134  fn("MaxDetections", std::to_string(desc.m_MaxDetections));
135  fn("MaxClassesPerDetection", std::to_string(desc.m_MaxClassesPerDetection));
136  fn("DetectionsPerClass", std::to_string(desc.m_DetectionsPerClass));
137  fn("NmsScoreThreshold", std::to_string(desc.m_NmsScoreThreshold));
138  fn("NmsIouThreshold", std::to_string(desc.m_NmsIouThreshold));
139  fn("NumClasses", std::to_string(desc.m_NumClasses));
140  fn("UseRegularNms", (desc.m_UseRegularNms ? "true" : "false"));
141  {
142  std::stringstream ss;
143  ss << "(" << desc.m_ScaleX << "," << desc.m_ScaleY << ")";
144  fn("Scale(X,Y)", ss.str());
145  }
146 
147  {
148  std::stringstream ss;
149  ss << "(" << desc.m_ScaleW << "," << desc.m_ScaleH << ")";
150  fn("Scale(W,H)", ss.str());
151  }
152 }
153 
157 {
158  {
159  std::stringstream ss;
160  ss << "(" << desc.m_PadTop << "," << desc.m_PadLeft
161  << "," << desc.m_PadBottom << "," << desc.m_PadRight << ")";
162  fn("Padding(T,L,B,R)",ss.str());
163  }
164 
165  {
166  std::stringstream ss;
167  ss << "(" << desc.m_StrideX << "," << desc.m_StrideY << ")";
168  fn("Stride(X,Y)", ss.str());
169  }
170 
171  {
172  std::stringstream ss;
173  ss << "(" << desc.m_DilationX << "," << desc.m_DilationY << ")";
174  fn("Dilation(X,Y)", ss.str());
175  }
176 
177  fn("BiasEnabled",(desc.m_BiasEnabled ? "true" : "false"));
178  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
179 }
180 
182  const ElementwiseUnaryDescriptor& desc)
183 {
184  fn("UnaryOperation", GetUnaryOperationAsCString(desc.m_Operation));
185 }
186 
188  const FakeQuantizationDescriptor& desc)
189 {
190  fn("Min", std::to_string(desc.m_Min));
191  fn("Max", std::to_string(desc.m_Max));
192 }
193 
195  const FullyConnectedDescriptor& desc)
196 {
197  fn("BiasEnabled", (desc.m_BiasEnabled ? "true" : "false"));
198  fn("TransposeWeightMatrix", (desc.m_TransposeWeightMatrix ? "true" : "false"));
199 }
200 
202  const L2NormalizationDescriptor& desc)
203 {
204  fn("Eps", std::to_string(desc.m_Eps));
205  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
206 }
207 
209 {
210  fn("ActivationFunc", std::to_string(desc.m_ActivationFunc));
211  fn("ClippingThresCell", std::to_string(desc.m_ClippingThresCell));
212  fn("ClippingThresProj", std::to_string(desc.m_ClippingThresProj));
213  fn("CifgEnabled", (desc.m_CifgEnabled ? "true" : "false")) ;
214  fn("PeepholeEnabled", (desc.m_PeepholeEnabled ? "true" : "false")) ;
215  fn("ProjectionEnabled", (desc.m_ProjectionEnabled ? "true" : "false")) ;
216  fn("LayerNormEnabled", (desc.m_LayerNormEnabled ? "true" : "false"));
217 }
218 
220 {
221  {
222  std::stringstream ss;
223  int count = 0;
224  for (auto&& var : desc.m_Axis)
225  {
226  if (count > 0)
227  {
228  ss << ",";
229  }
230  ss << var;
231  ++count;
232  }
233  fn("Axis", ss.str());
234  }
235  fn("KeepDims", (desc.m_KeepDims ? "true" : "false"));
236 }
237 
239  const NormalizationDescriptor& desc)
240 {
243  fn("NormSize", std::to_string(desc.m_NormSize));
244  fn("Alpha", std::to_string(desc.m_Alpha));
245  fn("Beta", std::to_string(desc.m_Beta));
246  fn("K", std::to_string(desc.m_K));
247  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
248 }
249 
251  const OriginsDescriptor& desc)
252 {
253  fn("ConcatAxis", std::to_string(desc.GetConcatAxis()));
254 
255  uint32_t numViews = desc.GetNumViews();
256  uint32_t numDims = desc.GetNumDimensions();
257 
258  for (uint32_t view = 0; view < numViews; ++view)
259  {
260  std::stringstream key;
261  key << "MergeTo#" << view;
262  std::stringstream value;
263  value << "[";
264  auto viewData = desc.GetViewOrigin(view);
265 
266  for (uint32_t dim = 0; dim < numDims; ++dim)
267  {
268  if (dim > 0)
269  {
270  value << ",";
271  }
272  value << viewData[dim];
273  }
274  value << "]";
275  fn(key.str(), value.str());
276  }
277 }
278 
280 {
281  {
282  std::stringstream ss;
283  int count = 0;
284  for (auto&& var : desc.m_PadList)
285  {
286  if (count > 0)
287  {
288  ss << ",";
289  }
290  ss << "[" << var.first << "," << var.second << "]";
291  ++count;
292  }
293  fn("PadList", ss.str());
294  }
295  fn("PadValue", std::to_string(desc.m_PadValue));
296  fn("PaddingMode", GetPaddingModeAsCString(desc.m_PaddingMode));
297 }
298 
300  const PreCompiledDescriptor& desc)
301 {
302  fn("NumInputSlots", std::to_string(desc.m_NumInputSlots));
303  fn("NumOutputSlots", std::to_string(desc.m_NumOutputSlots));
304 }
305 
307  const Pooling2dDescriptor& desc)
308 {
309  fn("Type", GetPoolingAlgorithmAsCString(desc.m_PoolType));
310  {
311  std::stringstream ss;
312  ss << "(" << desc.m_PadTop << "," << desc.m_PadLeft
313  << "," << desc.m_PadBottom << "," << desc.m_PadRight << ")";
314  fn("Padding(T,L,B,R)", ss.str());
315  }
316 
317  {
318  std::stringstream ss;
319  ss << "(" << desc.m_PoolWidth << "," << desc.m_PoolHeight << ")";
320  fn("(Width,Height)", ss.str());
321  }
322 
323  {
324  std::stringstream ss;
325  ss << "(" << desc.m_StrideX << "," << desc.m_StrideY << ")";
326  fn("Stride(X,Y)", ss.str());
327  }
328 
329  fn("OutputShapeRounding", GetOutputShapeRoundingAsCString(desc.m_OutputShapeRounding));
330  fn("PaddingMethod", GetPaddingMethodAsCString(desc.m_PaddingMethod));
331  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
332 }
333 
335  const PermuteDescriptor& desc)
336 {
337  std::stringstream ss;
338  ss << "[";
339  bool addComma = false;
340  for (auto it : desc.m_DimMappings)
341  {
342  if (addComma)
343  {
344  ss << ",";
345  }
346  ss << it;
347  addComma = true;
348  }
349  ss << "]";
350 
351  fn("DimMappings",ss.str());
352 }
353 
355 {
356  {
357  std::stringstream ss;
358  int count = 0;
359  for (auto&& var : desc.m_vAxis)
360  {
361  if (count > 0)
362  {
363  ss << ",";
364  }
365  ss << var;
366  ++count;
367  }
368  fn("Axis", ss.str());
369  }
370  fn("KeepDims", (desc.m_KeepDims ? "true" : "false"));
371  fn("ReduceOperation", GetReduceOperationAsCString(desc.m_ReduceOperation));
372 }
373 
375  const ReshapeDescriptor& desc)
376 {
377  std::stringstream ss;
378  ss << desc.m_TargetShape;
379  fn("TargetShape",ss.str());
380 }
381 
383  const ResizeDescriptor& desc)
384 {
385  fn("TargetWidth", std::to_string(desc.m_TargetWidth));
386  fn("TargetHeight", std::to_string(desc.m_TargetHeight));
387  fn("ResizeMethod", GetResizeMethodAsCString(desc.m_Method));
388  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
389  fn("AlignCorners", std::to_string(desc.m_AlignCorners));
390  fn("HalfPixelCenters", std::to_string(desc.m_HalfPixelCenters));
391 }
392 
394  const SoftmaxDescriptor& desc)
395 {
396  fn("Beta", std::to_string(desc.m_Beta));
397  fn("Axis", std::to_string(desc.m_Axis));
398 }
399 
401  const SpaceToBatchNdDescriptor& desc)
402 {
403  {
404  std::stringstream ss;
405  int count = 0;
406  for (auto&& var : desc.m_BlockShape)
407  {
408  if (count > 0)
409  {
410  ss << ",";
411  }
412  ss << var;
413  ++count;
414  }
415  fn("BlockShape", ss.str());
416  }
417 
418  {
419  std::stringstream ss;
420  int count = 0;
421  for (auto&& var : desc.m_PadList)
422  {
423  if (count > 0)
424  {
425  ss << ",";
426  }
427  ss << "[" << var.first << "," << var.second << "]";
428  ++count;
429  }
430  fn("PadList", ss.str());
431  }
432 
433  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
434 }
435 
437  const SpaceToDepthDescriptor& desc)
438 {
439  fn("BlockSize", std::to_string(desc.m_BlockSize));
440  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
441 }
442 
444 {
445  fn("Axis", std::to_string(desc.m_Axis));
446  fn("NumInputs", std::to_string(desc.m_NumInputs));
447  {
448  std::stringstream ss;
449  ss << desc.m_InputShape;
450  fn("InputShape",ss.str());
451  }
452 }
453 
455  const StridedSliceDescriptor& desc)
456 {
457  {
458  std::stringstream ss;
459  int count = 0;
460  for (auto&& var : desc.m_Begin)
461  {
462  if (count > 0)
463  {
464  ss << ",";
465  }
466  ss << var;
467  ++count;
468  }
469  fn("Begin", ss.str());
470  }
471 
472  {
473  std::stringstream ss;
474  int count = 0;
475  for (auto&& var : desc.m_End)
476  {
477  if (count > 0)
478  {
479  ss << ",";
480  }
481  ss << var;
482  ++count;
483  }
484  fn("End", ss.str());
485  }
486 
487  {
488  std::stringstream ss;
489  int count = 0;
490  for (auto&& var : desc.m_Stride)
491  {
492  if (count > 0)
493  {
494  ss << ",";
495  }
496  ss << var;
497  ++count;
498  }
499  fn("Stride", ss.str());
500  }
501 
502  fn("BeginMask", std::to_string(desc.m_BeginMask));
503  fn("EndMask", std::to_string(desc.m_EndMask));
504  fn("ShrinkAxisMask", std::to_string(desc.m_ShrinkAxisMask));
505  fn("EllipsisMask", std::to_string(desc.m_EllipsisMask));
506  fn("NewAxisMask", std::to_string(desc.m_NewAxisMask));
507  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
508 }
509 
513 {
514  {
515  std::stringstream ss;
516  ss << "(" << desc.m_PadTop << "," << desc.m_PadLeft
517  << "," << desc.m_PadBottom << "," << desc.m_PadRight << ")";
518  fn("Padding(T,L,B,R)",ss.str());
519  }
520 
521  {
522  std::stringstream ss;
523  ss << "(" << desc.m_StrideX << "," << desc.m_StrideY << ")";
524  fn("Stride(X,Y)", ss.str());
525  }
526 
527  fn("BiasEnabled", (desc.m_BiasEnabled ? "true" : "false"));
528  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
529 }
530 
532  const TransposeDescriptor& desc)
533 {
534  std::stringstream ss;
535  ss << "[";
536  bool addComma = false;
537  for (auto it : desc.m_DimMappings)
538  {
539  if (addComma)
540  {
541  ss << ",";
542  }
543  ss << it;
544  addComma = true;
545  }
546  ss << "]";
547 
548  fn("DimMappings",ss.str());
549 }
550 
552 {
553  uint32_t numViews = desc.GetNumViews();
554  uint32_t numDims = desc.GetNumDimensions();
555  for (uint32_t view = 0; view < numViews; ++view) {
556  std::stringstream key;
557  key << "ViewSizes#" << view;
558  std::stringstream value;
559  value << "[";
560  auto viewData = desc.GetViewSizes(view);
561  for (uint32_t dim = 0; dim < numDims; ++dim)
562  {
563  if (dim > 0)
564  {
565  value << ",";
566  }
567  value << viewData[dim];
568  }
569  value << "]";
570  fn(key.str(), value.str());
571  }
573 }
574 
575 } // namespace armnn
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
float m_Eps
Used to avoid dividing by zero.
bool m_ProjectionEnabled
Enable/disable the projection layer.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
uint32_t m_Axis
0-based axis along which to stack the input tensors.
A ViewsDescriptor for the SplitterLayer.
constexpr const char * GetDataLayoutName(DataLayout dataLayout)
Definition: TypesUtils.hpp:222
float m_ScaleW
Center size encoding scale weight.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
float m_K
Kappa value used for the across channel normalization equation.
int m_Axis
Scalar, defaulted to the last index (-1), specifying the dimension the activation will be performed o...
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
uint32_t m_PadLeft
Padding left value in the width dimension.
float m_ClippingThresProj
Clipping threshold value for the projection.
int32_t m_ShrinkAxisMask
Shrink axis mask value. If set, the nth specification shrinks the dimensionality by 1...
A ReshapeDescriptor for the ReshapeLayer.
std::vector< int > m_Begin
Begin values for the input that will be sliced.
constexpr const char * GetResizeMethodAsCString(ResizeMethod method)
Definition: TypesUtils.hpp:254
uint32_t m_PadBack
Padding back value in the depth dimension.
float m_PadValue
Optional value to use for padding, defaults to 0.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
uint32_t GetNumDimensions() const
Get the number of dimensions.
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:78
float m_ScaleX
Center size encoding scale x.
TensorShape m_InputShape
Required shape of all input tensors.
bool m_TransposeWeightMatrix
Enable/disable transpose weight matrix.
uint32_t m_PoolWidth
Pooling width value.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
A Convolution2dDescriptor for the Convolution2dLayer.
float m_Alpha
Alpha value for the normalization equation.
uint32_t m_PadLeft
Padding left value in the width dimension.
bool m_KeepDims
if true then output shape has no change.
bool m_BiasEnabled
Enable/disable bias.
ResizeMethod m_Method
The Interpolation method to use (Bilinear, NearestNeighbor).
float m_Beta
Exponentiation value.
float m_Eps
Value to add to the variance. Used to avoid dividing by zero.
PaddingMethod m_PaddingMethod
The padding method to be used. (Exclude, IgnoreValue).
uint32_t m_DetectionsPerClass
Detections per classes, used in Regular NMS.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
constexpr char const * GetPoolingAlgorithmAsCString(PoolingAlgorithm pooling)
Definition: TypesUtils.hpp:97
uint32_t m_PadRight
Padding right value in the width dimension.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
std::vector< std::pair< unsigned int, unsigned int > > m_PadList
Specifies the padding for input dimension.
uint32_t GetNumViews() const
Get the number of views.
ReduceOperation m_ReduceOperation
Specifies the reduction operation to execute.
Copyright (c) 2021 ARM Limited and Contributors.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
int32_t m_BeginMask
Begin mask value.
constexpr char const * GetOutputShapeRoundingAsCString(OutputShapeRounding rounding)
Definition: TypesUtils.hpp:108
uint32_t m_DilationY
Dilation along y axis.
int32_t m_EndMask
End mask value.
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
std::vector< std::pair< unsigned int, unsigned int > > m_PadList
Specifies the padding values for the input dimension: heightPad{top, bottom} widthPad{left, right}.
uint32_t m_DilationX
Dilation along x axis.
uint32_t m_DilationY
Dilation factor value for height dimension.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
PermutationVector m_DimMappings
Indicates how to translate tensor elements from a given source into the target destination, when source and target potentially have different memory layouts e.g.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
NormalizationAlgorithmMethod m_NormMethodType
Normalization method algorithm to use (LocalBrightness, LocalContrast).
A ResizeBilinearDescriptor for the ResizeBilinearLayer.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
uint32_t m_MaxClassesPerDetection
Maximum numbers of classes per detection, used in Fast NMS.
std::vector< unsigned int > m_Axis
Values for the dimensions to reduce.
A StackDescriptor for the StackLayer.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
constexpr char const * GetUnaryOperationAsCString(UnaryOperation operation)
Definition: TypesUtils.hpp:71
TensorShape m_TargetShape
Target shape value.
uint32_t m_PoolHeight
Pooling height value.
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_MaxDetections
Maximum numbers of detections.
A PadDescriptor for the PadLayer.
const uint32_t * GetViewOrigin(uint32_t idx) const
Return the view origin at the int value idx.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
constexpr char const * GetPaddingModeAsCString(PaddingMode mode)
Definition: TypesUtils.hpp:128
float m_NmsIouThreshold
Intersection over union threshold.
An LstmDescriptor for the LstmLayer.
uint32_t m_PadRight
Padding right value in the width dimension.
uint32_t m_DilationX
Dilation factor value for width dimension.
uint32_t m_PadTop
Padding top value in the height dimension.
int32_t m_NewAxisMask
New axis mask value.
bool m_KeepDims
Enable/disable keep dimensions. If true, then the reduced dimensions that are of length 1 are kept...
std::vector< unsigned int > m_BlockShape
Block shape values.
A L2NormalizationDescriptor for the L2NormalizationLayer.
An OriginsDescriptor for the ConcatLayer.
A ReduceDescriptor for the REDUCE operators.
A FullyConnectedDescriptor for the FullyConnectedLayer.
int32_t m_EllipsisMask
Ellipsis mask value.
bool m_BiasEnabled
Enable/disable bias.
A FakeQuantizationDescriptor for the FakeQuantizationLayer.
uint32_t m_TargetWidth
Target width value.
bool m_PeepholeEnabled
Enable/disable peephole.
uint32_t m_NumClasses
Number of classes.
bool m_HalfPixelCenters
Half Pixel Centers.
uint32_t m_PadTop
Padding top value in the height dimension.
bool m_UseRegularNms
Use Regular NMS.
uint32_t m_PadFront
Padding front value in the depth dimension.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
std::vector< unsigned int > m_BlockShape
Block shape value.
std::vector< int > m_Stride
Stride values for the input that will be sliced.
constexpr const char * GetNormalizationAlgorithmMethodAsCString(NormalizationAlgorithmMethod method)
Definition: TypesUtils.hpp:244
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:25
uint32_t m_NumInputs
Number of input tensors.
uint32_t m_PadLeft
Padding left value in the width dimension.
uint32_t m_TargetHeight
Target height value.
uint32_t m_ActivationFunc
The activation function to use.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
A Convolution3dDescriptor for the Convolution3dLayer.
uint32_t m_PadRight
Padding right value in the width dimension.
float m_ClippingThresCell
Clipping threshold value for the cell state.
unsigned int m_BlockSize
Scalar specifying the input block size. It must be >= 1.
uint32_t m_NumGroups
Number of groups for the channel shuffle operation.
PaddingMode m_PaddingMode
Specifies the Padding mode (Constant, Reflect or Symmetric)
constexpr const char * GetNormalizationAlgorithmChannelAsCString(NormalizationAlgorithmChannel channel)
Definition: TypesUtils.hpp:234
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
std::vector< uint32_t > m_vAxis
The indices of the dimensions to reduce.
float m_ScaleH
Center size encoding scale height.
ComparisonOperation m_Operation
Specifies the comparison operation to execute.
Definition: Descriptors.hpp:94
std::vector< int > m_End
End values for the input that will be sliced.
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
DataLayout m_DataLayout
The data layout to be used (NDHWC, NCDHW).
NormalizationAlgorithmChannel m_NormChannelType
Normalization channel algorithm to use (Across, Within).
const uint32_t * GetViewSizes(uint32_t idx) const
Get the view sizes at the int value idx.
float m_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH, Elu).
Definition: Descriptors.hpp:50
uint32_t m_DilationX
Dilation along x axis.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
bool m_CifgEnabled
Enable/disable cifg (coupled input & forget gate).
uint32_t m_PadLeft
Padding left value in the width dimension.
bool m_AlignCorners
Aligned corners.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
Definition: Descriptors.hpp:98
PoolingAlgorithm m_PoolType
The pooling algorithm to use (Max. Average, L2).
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
std::vector< std::pair< unsigned int, unsigned int > > m_Crops
The values to crop from the input dimension.
uint32_t m_PadTop
Padding top value in the height dimension.
OutputShapeRounding m_OutputShapeRounding
The rounding method for the output shape. (Floor, Ceiling).
constexpr char const * GetComparisonOperationAsCString(ComparisonOperation operation)
Definition: TypesUtils.hpp:57
uint32_t GetNumDimensions() const
Get the number of dimensions.
A MeanDescriptor for the MeanLayer.
constexpr char const * GetActivationFunctionAsCString(ActivationFunction activation)
Definition: TypesUtils.hpp:27
bool m_LayerNormEnabled
Enable/disable layer normalization.
uint32_t m_PadRight
Padding right value in the width dimension.
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
constexpr char const * GetReduceOperationAsCString(ReduceOperation reduce_operation)
Definition: TypesUtils.hpp:139
uint32_t m_Axis
Axis to apply channel shuffle operation on.
float m_ScaleY
Center size encoding scale y.
uint32_t GetNumViews() const
Get the number of views.
float m_NmsScoreThreshold
NMS score threshold.
constexpr char const * GetPaddingMethodAsCString(PaddingMethod method)
Definition: TypesUtils.hpp:118
A PreCompiledDescriptor for the PreCompiledLayer.
A Pooling2dDescriptor for the Pooling2dLayer.
A NormalizationDescriptor for the NormalizationLayer.
std::function< void(const std::string &name, const std::string &value)> ParameterStringifyFunction
static void Serialize(ParameterStringifyFunction &, const LayerParameter &)
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
unsigned int GetConcatAxis() const
Get the concatenation axis value.
A ChannelShuffleDescriptor for the ChannelShuffle operator.
uint32_t m_DilationZ
Dilation along z axis.
float m_B
Beta lower bound value used by the activation functions. (BoundedReLu, Linear, TanH).
Definition: Descriptors.hpp:52
A SoftmaxDescriptor for the SoftmaxLayer.
float m_Beta
Beta value for the normalization equation.
uint32_t m_StrideZ
Stride value when proceeding through input for the depth dimension.
const OriginsDescriptor & GetOrigins() const
Get the View Origins.
PermutationVector m_DimMappings
Indicates how to translate tensor elements from a given source into the target destination, when source and target potentially have different memory layouts e.g.
uint32_t m_NormSize
Depth radius value.
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).
Definition: Descriptors.hpp:48
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
uint32_t m_DilationY
Dilation along y axis.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
uint32_t m_PadLeft
Padding left value in the width dimension.
A PermuteDescriptor for the PermuteLayer.
uint32_t m_PadRight
Padding right value in the width dimension.