ArmNN
 22.05.01
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,Z)", 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 Pooling3dDescriptor& desc)
336 {
337  fn("Type", GetPoolingAlgorithmAsCString(desc.m_PoolType));
338  {
339  std::stringstream ss;
340  ss << "(" << desc.m_PadTop << "," << desc.m_PadLeft
341  << "," << desc.m_PadBottom << "," << desc.m_PadRight
342  << "," << desc.m_PadFront << "," << desc.m_PadBack << ")";
343  fn("Padding(T,L,B,R,F,B)", ss.str());
344  }
345 
346  {
347  std::stringstream ss;
348  ss << "(" << desc.m_PoolWidth << "," << desc.m_PoolHeight << "," << desc.m_PoolDepth << ")";
349  fn("(Width,Height,Depth)", ss.str());
350  }
351 
352  {
353  std::stringstream ss;
354  ss << "(" << desc.m_StrideX << "," << desc.m_StrideY << "," << desc.m_StrideZ << ")";
355  fn("Stride(X,Y,Z)", ss.str());
356  }
357 
358  fn("OutputShapeRounding", GetOutputShapeRoundingAsCString(desc.m_OutputShapeRounding));
359  fn("PaddingMethod", GetPaddingMethodAsCString(desc.m_PaddingMethod));
360  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
361 }
362 
364  const PermuteDescriptor& desc)
365 {
366  std::stringstream ss;
367  ss << "[";
368  bool addComma = false;
369  for (auto it : desc.m_DimMappings)
370  {
371  if (addComma)
372  {
373  ss << ",";
374  }
375  ss << it;
376  addComma = true;
377  }
378  ss << "]";
379 
380  fn("DimMappings",ss.str());
381 }
382 
384 {
385  {
386  std::stringstream ss;
387  int count = 0;
388  for (auto&& var : desc.m_vAxis)
389  {
390  if (count > 0)
391  {
392  ss << ",";
393  }
394  ss << var;
395  ++count;
396  }
397  fn("Axis", ss.str());
398  }
399  fn("KeepDims", (desc.m_KeepDims ? "true" : "false"));
400  fn("ReduceOperation", GetReduceOperationAsCString(desc.m_ReduceOperation));
401 }
402 
404  const ReshapeDescriptor& desc)
405 {
406  std::stringstream ss;
407  ss << desc.m_TargetShape;
408  fn("TargetShape",ss.str());
409 }
410 
412  const ResizeDescriptor& desc)
413 {
414  fn("TargetWidth", std::to_string(desc.m_TargetWidth));
415  fn("TargetHeight", std::to_string(desc.m_TargetHeight));
416  fn("ResizeMethod", GetResizeMethodAsCString(desc.m_Method));
417  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
418  fn("AlignCorners", std::to_string(desc.m_AlignCorners));
419  fn("HalfPixelCenters", std::to_string(desc.m_HalfPixelCenters));
420 }
421 
423  const SoftmaxDescriptor& desc)
424 {
425  fn("Beta", std::to_string(desc.m_Beta));
426  fn("Axis", std::to_string(desc.m_Axis));
427 }
428 
430  const SpaceToBatchNdDescriptor& desc)
431 {
432  {
433  std::stringstream ss;
434  int count = 0;
435  for (auto&& var : desc.m_BlockShape)
436  {
437  if (count > 0)
438  {
439  ss << ",";
440  }
441  ss << var;
442  ++count;
443  }
444  fn("BlockShape", ss.str());
445  }
446 
447  {
448  std::stringstream ss;
449  int count = 0;
450  for (auto&& var : desc.m_PadList)
451  {
452  if (count > 0)
453  {
454  ss << ",";
455  }
456  ss << "[" << var.first << "," << var.second << "]";
457  ++count;
458  }
459  fn("PadList", ss.str());
460  }
461 
462  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
463 }
464 
466  const SpaceToDepthDescriptor& desc)
467 {
468  fn("BlockSize", std::to_string(desc.m_BlockSize));
469  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
470 }
471 
473 {
474  fn("Axis", std::to_string(desc.m_Axis));
475  fn("NumInputs", std::to_string(desc.m_NumInputs));
476  {
477  std::stringstream ss;
478  ss << desc.m_InputShape;
479  fn("InputShape",ss.str());
480  }
481 }
482 
484  const StridedSliceDescriptor& desc)
485 {
486  {
487  std::stringstream ss;
488  int count = 0;
489  for (auto&& var : desc.m_Begin)
490  {
491  if (count > 0)
492  {
493  ss << ",";
494  }
495  ss << var;
496  ++count;
497  }
498  fn("Begin", ss.str());
499  }
500 
501  {
502  std::stringstream ss;
503  int count = 0;
504  for (auto&& var : desc.m_End)
505  {
506  if (count > 0)
507  {
508  ss << ",";
509  }
510  ss << var;
511  ++count;
512  }
513  fn("End", ss.str());
514  }
515 
516  {
517  std::stringstream ss;
518  int count = 0;
519  for (auto&& var : desc.m_Stride)
520  {
521  if (count > 0)
522  {
523  ss << ",";
524  }
525  ss << var;
526  ++count;
527  }
528  fn("Stride", ss.str());
529  }
530 
531  fn("BeginMask", std::to_string(desc.m_BeginMask));
532  fn("EndMask", std::to_string(desc.m_EndMask));
533  fn("ShrinkAxisMask", std::to_string(desc.m_ShrinkAxisMask));
534  fn("EllipsisMask", std::to_string(desc.m_EllipsisMask));
535  fn("NewAxisMask", std::to_string(desc.m_NewAxisMask));
536  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
537 }
538 
542 {
543  {
544  std::stringstream ss;
545  ss << "(" << desc.m_PadTop << "," << desc.m_PadLeft
546  << "," << desc.m_PadBottom << "," << desc.m_PadRight << ")";
547  fn("Padding(T,L,B,R)",ss.str());
548  }
549 
550  {
551  std::stringstream ss;
552  ss << "(" << desc.m_StrideX << "," << desc.m_StrideY << ")";
553  fn("Stride(X,Y)", ss.str());
554  }
555 
556  fn("BiasEnabled", (desc.m_BiasEnabled ? "true" : "false"));
557  fn("DataLayout", GetDataLayoutName(desc.m_DataLayout));
558 }
559 
561  const TransposeDescriptor& desc)
562 {
563  std::stringstream ss;
564  ss << "[";
565  bool addComma = false;
566  for (auto it : desc.m_DimMappings)
567  {
568  if (addComma)
569  {
570  ss << ",";
571  }
572  ss << it;
573  addComma = true;
574  }
575  ss << "]";
576 
577  fn("DimMappings",ss.str());
578 }
579 
581 {
582  uint32_t numViews = desc.GetNumViews();
583  uint32_t numDims = desc.GetNumDimensions();
584  for (uint32_t view = 0; view < numViews; ++view) {
585  std::stringstream key;
586  key << "ViewSizes#" << view;
587  std::stringstream value;
588  value << "[";
589  auto viewData = desc.GetViewSizes(view);
590  for (uint32_t dim = 0; dim < numDims; ++dim)
591  {
592  if (dim > 0)
593  {
594  value << ",";
595  }
596  value << viewData[dim];
597  }
598  value << "]";
599  fn(key.str(), value.str());
600  }
602 }
603 
604 } // namespace armnn
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
PoolingAlgorithm m_PoolType
The pooling algorithm to use (Max. Average, L2).
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_StrideY
Stride value when proceeding through input for the height dimension.
uint32_t m_PoolWidth
Pooling width value.
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.
uint32_t m_PoolDepth
Pooling depth value.
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:89
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_PadRight
Padding right value in the width dimension.
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.
DataLayout m_DataLayout
The data layout to be used (NCDHW, NDHWC).
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_PadFront
Padding front value in the depth dimension.
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_PoolHeight
Pooling height value.
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_PadBack
Padding back value in the depth 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.
OutputShapeRounding m_OutputShapeRounding
The rounding method for the output shape. (Floor, Ceiling).
A FakeQuantizationDescriptor for the FakeQuantizationLayer.
uint32_t m_TargetWidth
Target width value.
uint32_t m_PadBottom
Padding bottom value in the height dimension.
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:36
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).
A Pooling3dDescriptor for the Pooling3dLayer.
uint32_t m_StrideZ
Stride value when proceeding through input for the depth dimension.
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.
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:61
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.
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.
uint32_t m_PadLeft
Padding left value in the width 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.
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 &)
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
PaddingMethod m_PaddingMethod
The padding method to be used. (Exclude, IgnoreValue).
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:63
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:59
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.