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