From ae050524109f1ce827962665436ef7430f2ac479 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Wed, 22 Mar 2023 16:48:58 +0000 Subject: IVGCVSW-7255 Update Doxygen Documentation and publish on GitHub. * Updating Doxygen documentation for 23.02 release. Signed-off-by: David Monahan Change-Id: I545574ff7664b4595d2fe6a91a3c35d2ad55df82 --- 23.02/_descriptors_8hpp_source.xhtml | 2395 +++++++++++++++++++++++++++++----- 1 file changed, 2035 insertions(+), 360 deletions(-) (limited to '23.02/_descriptors_8hpp_source.xhtml') diff --git a/23.02/_descriptors_8hpp_source.xhtml b/23.02/_descriptors_8hpp_source.xhtml index 7d397a4d9c..ecaafebc87 100644 --- a/23.02/_descriptors_8hpp_source.xhtml +++ b/23.02/_descriptors_8hpp_source.xhtml @@ -8,7 +8,7 @@ - + ArmNN: include/armnn/Descriptors.hpp Source File @@ -19,9 +19,6 @@ - @@ -30,7 +27,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -51,18 +49,21 @@ - + +/* @license-end */
@@ -76,7 +77,9 @@ $(function() {
@@ -98,365 +101,2037 @@ $(document).ready(function(){initNavTree('_descriptors_8hpp_source.xhtml','');})
Descriptors.hpp
-Go to the documentation of this file.
1 //
2 // Copyright © 2017,2022 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include "Deprecated.hpp"
8 #include "DescriptorsFwd.hpp" // Required for class equivalence declarations.
9 #include "Tensor.hpp"
10 #include "Types.hpp"
11 #include <armnn/Exceptions.hpp>
12 
13 #include <cstdint>
14 #include <iterator>
15 #include <utility>
16 #include <vector>
17 
18 namespace armnn
19 {
20 
21 /// Base class for all descriptors.
23 {
24  virtual bool IsNull() const { return false; }
25  virtual ~BaseDescriptor() = default;
26 };
27 
28 /// Null Descriptor used as a return value from the IConnectableLayer GetParameters method
29 /// by layers which do not have a descriptor
31 {
32  bool IsNull() const override { return true; }
33 };
34 
35 /// An ActivationDescriptor for the ActivationLayer.
37 {
39  : m_Function(ActivationFunction::Sigmoid)
40  , m_A(0)
41  , m_B(0)
42  {}
43 
45  float a = 0,
46  float b = 0)
47  : m_Function(activation)
48  , m_A(a)
49  , m_B(b)
50  {}
51 
52  bool operator ==(const ActivationDescriptor &rhs) const
53  {
54  return m_Function == rhs.m_Function && m_A == rhs.m_B && m_B == rhs.m_B;
55  }
56 
57  /// @brief The activation function to use
58  /// (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).
60  /// Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH, Elu).
61  float m_A;
62  /// Beta lower bound value used by the activation functions. (BoundedReLu, Linear, TanH).
63  float m_B;
64 };
65 
66 /// An ArgMinMaxDescriptor for ArgMinMaxLayer
68 {
70  : m_Function(ArgMinMaxFunction::Min)
71  , m_Axis(-1)
72  , m_Output_Type(armnn::DataType::Signed32)
73  {}
74 
75  bool operator ==(const ArgMinMaxDescriptor &rhs) const
76  {
77  return m_Function == rhs.m_Function && m_Axis == rhs.m_Axis && m_Output_Type == rhs.m_Output_Type;
78  }
79 
80  /// Specify if the function is to find Min or Max.
82  /// Axis to reduce across the input tensor.
83  int m_Axis;
84  /// Deprecated and will be removed in future release.
86 };
87 
88 /// A ComparisonDescriptor for the ComparisonLayer
90 {
93  {}
94 
96  : m_Operation(operation)
97  {}
98 
99  bool operator ==(const ComparisonDescriptor &rhs) const
100  {
101  return m_Operation == rhs.m_Operation;
102  }
103 
104  /// Specifies the comparison operation to execute
106 };
107 
108 /// A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer
110 {
113  {}
114 
116  : m_Operation(operation)
117  {}
118 
120  {
121  return m_Operation == rhs.m_Operation;
122  }
123 
124  /// Specifies the elementwiseUnary operation to execute
126 };
127 
128 /// A PermuteDescriptor for the PermuteLayer.
130 {
132  : m_DimMappings{}
133  {}
134 
136  : m_DimMappings(dimMappings)
137  {}
138 
139  bool operator ==(const PermuteDescriptor &rhs) const
140  {
141  return m_DimMappings.IsEqual(rhs.m_DimMappings);
142  }
143 
144  /// @brief Indicates how to translate tensor elements from a given source into the target destination, when
145  /// source and target potentially have different memory layouts e.g.
146  /// Input Shape {1, 1, 4, 4}
147  /// Permutation Vector {0, 2, 3, 1}
148  /// Output Shape {1, 4, 1, 4}
149  /// dim "0" goes into index 0 ([ 1, X, X, X ])
150  /// dim "1" goes into index 2 ([ 1, X, 1, X ])
151  /// dim "2" goes into index 3 ([ 1, X, 1, 4 ])
152  /// dim "3" goes into index 1 ([ 1, 4, 1, 4 ])
154 };
155 
156 /// A SoftmaxDescriptor for the SoftmaxLayer.
158 {
160  : m_Beta(1.0f)
161  , m_Axis(-1)
162  {}
163 
164  bool operator ==(const SoftmaxDescriptor& rhs) const
165  {
166  return m_Beta == rhs.m_Beta && m_Axis == rhs.m_Axis;
167  }
168 
169  /// Exponentiation value.
170  float m_Beta;
171  /// Scalar, defaulted to the last index (-1), specifying the dimension the activation will be performed on.
172  int m_Axis;
173 };
174 
175 /// A LogSoftmaxDescriptor for the LogSoftmaxLayer
177 
178 /// @brief An OriginsDescriptor for the ConcatLayer.
179 /// Descriptor to configure the concatenation process. Number of views must be equal to the number of inputs, and
180 /// their order must match - e.g. first view corresponds to the first input, second view to the second input, etc.
182 {
184  OriginsDescriptor(uint32_t numViews, uint32_t numDimensions = 4);
185  OriginsDescriptor(const OriginsDescriptor& other);
187 
189 
190  OriginsDescriptor& operator=(OriginsDescriptor rhs);
191 
192  bool operator ==(const OriginsDescriptor& rhs) const;
193 
194  /// @Brief Set the view origin coordinates. The arguments are: view, dimension, value.
195  /// If the view is greater than or equal to GetNumViews(), then the view argument is out of range.
196  /// If the coord is greater than or equal to GetNumDimensions(), then the coord argument is out of range.
197  Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value);
198  /// Get the number of views.
199  uint32_t GetNumViews() const;
200  /// Get the number of dimensions.
201  uint32_t GetNumDimensions() const;
202  /// Return the view origin at the int value idx.
203  const uint32_t* GetViewOrigin(uint32_t idx) const;
204  /// @brief Reorders the viewOrigins in accordance with the indices presented in newOrdering array.
205  /// The number of views must match number of elements in the new ordering array.
206  void ReorderOrigins(unsigned int* newOrdering, unsigned int numNewOrdering);
207  /// Swap the ViewsDescriptor values first and second.
208  friend void swap(OriginsDescriptor& first, OriginsDescriptor& second);
209  /// Set the concatenation axis value.
210  void SetConcatAxis(unsigned int concatAxis);
211  /// Get the concatenation axis value.
212  unsigned int GetConcatAxis() const;
213 
214 private:
215  unsigned int m_ConcatAxis;
216  uint32_t m_NumViews;
217  uint32_t m_NumDimensions;
218  uint32_t** m_ViewOrigins;
219 };
220 
221 /// @brief A ViewsDescriptor for the SplitterLayer.
222 /// Descriptor to configure the splitting process. Number of Views must be equal to the number of outputs, and
223 /// their order must match - e.g. first view corresponds to the first output, second view to the second output, etc.
225 {
226  ViewsDescriptor(uint32_t numViews, uint32_t numDimensions = 4);
227  ViewsDescriptor(const ViewsDescriptor& other);
228  ViewsDescriptor();
230 
231  ~ViewsDescriptor();
232 
233  ViewsDescriptor& operator=(ViewsDescriptor rhs);
234 
235  bool operator ==(const ViewsDescriptor& rhs) const;
236 
237  /// @Brief Set the view origin coordinates. The arguments are: view, dimension, value.
238  /// If the view is greater than or equal to GetNumViews(), then the view argument is out of range.
239  /// If the coord is greater than or equal to GetNumDimensions(), then the coord argument is out of range.
240  Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value);
241  /// @brief Set the size of the views. The arguments are: view, dimension, value.
242  /// If the view is greater than or equal to GetNumViews(), then the view argument is out of range.
243  /// If the coord is greater than or equal to GetNumDimensions(), then the coord argument is out of range.
244  Status SetViewSize(uint32_t view, uint32_t coord, uint32_t value);
245 
246  /// Get the number of views.
247  uint32_t GetNumViews() const;
248  /// Get the number of dimensions.
249  uint32_t GetNumDimensions() const;
250  /// Get the view origin at the int value idx.
251  const uint32_t* GetViewOrigin(uint32_t idx) const;
252  /// Get the view sizes at the int value idx.
253  const uint32_t* GetViewSizes(uint32_t idx) const;
254  /// Get the View Origins
255  const OriginsDescriptor& GetOrigins() const;
256 
257  /// Swap the ViewsDescriptor value first and second.
258  friend void swap(ViewsDescriptor& first, ViewsDescriptor& second);
259 private:
260  OriginsDescriptor m_Origins;
261  uint32_t** m_ViewSizes;
262 };
263 
264 
265 /// @brief Convenience template to create an OriginsDescriptor to use when creating a ConcatLayer for performing
266 /// concatenation of a number of input tensors.
267 template <typename TensorShapeIt>
269  TensorShapeIt last,
270  unsigned int concatenationDimension)
271 {
272  auto numInputs = std::distance(first, last);
273 
274  if (numInputs < 2)
275  {
276  throw InvalidArgumentException("Concatenation requires at least 2 inputs");
277  }
278 
279  const auto& firstInputShape = *first;
280 
281  const unsigned int numDimensions = firstInputShape.GetNumDimensions();
282  for (auto it = first + 1; it != last; ++it)
283  {
284  if (it->GetNumDimensions() != numDimensions)
285  {
286  throw InvalidArgumentException("All inputs to concatenation must have the same number of dimensions");
287  }
288  }
289 
290  if (concatenationDimension >= numDimensions)
291  {
292  throw InvalidArgumentException("concatenationDimension must be between 0 and the number of dimensions.");
293  }
294 
295  for (auto it = first; it != last; ++it)
296  {
297  for (unsigned int d = 0; d < numDimensions; ++d)
298  {
299  const bool dimSizeOk = (d == concatenationDimension) || (firstInputShape[d] == (*it)[d]);
300  if (!dimSizeOk)
301  {
302  throw InvalidArgumentException("All inputs to concatenation must be the same size along all dimensions "
303  " except the concatenation dimension");
304  }
305  }
306  }
307 
308  OriginsDescriptor viewsDescriptor(static_cast<uint32_t>(numInputs), numDimensions);
309  viewsDescriptor.SetConcatAxis(concatenationDimension);
310 
311  uint32_t viewIndex = 0u;
312  uint32_t coordAlongConcatDim = 0u;
313  for (auto it = first; it != last; ++it)
314  {
315  const auto& inputShape = *it;
316 
317  for (unsigned int i = 0; i < concatenationDimension; ++i)
318  {
319  viewsDescriptor.SetViewOriginCoord(viewIndex, i, 0);
320  }
321 
322  viewsDescriptor.SetViewOriginCoord(viewIndex, concatenationDimension, coordAlongConcatDim);
323  unsigned int dimSize = inputShape[concatenationDimension];
324  coordAlongConcatDim += dimSize;
325 
326 
327  for (unsigned int i = concatenationDimension + 1; i < numDimensions; ++i)
328  {
329  viewsDescriptor.SetViewOriginCoord(viewIndex, i, 0);
330  }
331 
332  ++viewIndex;
333  }
334 
335  return viewsDescriptor;
336 }
337 
338 /// A Pooling2dDescriptor for the Pooling2dLayer.
340 {
342  : m_PoolType(PoolingAlgorithm::Max)
343  , m_PadLeft(0)
344  , m_PadRight(0)
345  , m_PadTop(0)
346  , m_PadBottom(0)
347  , m_PoolWidth(0)
348  , m_PoolHeight(0)
349  , m_StrideX(0)
350  , m_StrideY(0)
351  , m_OutputShapeRounding(OutputShapeRounding::Floor)
352  , m_PaddingMethod(PaddingMethod::Exclude)
353  , m_DataLayout(DataLayout::NCHW)
354  {}
355 
356  bool operator ==(const Pooling2dDescriptor& rhs) const
357  {
358  return m_PoolType == rhs.m_PoolType &&
359  m_PadLeft == rhs.m_PadLeft &&
360  m_PadRight == rhs.m_PadRight &&
361  m_PadTop == rhs.m_PadTop &&
362  m_PadBottom == rhs.m_PadBottom &&
363  m_PoolWidth == rhs.m_PoolWidth &&
364  m_PoolHeight == rhs.m_PoolHeight &&
365  m_StrideX == rhs.m_StrideX &&
366  m_StrideY == rhs.m_StrideY &&
367  m_OutputShapeRounding == rhs.m_OutputShapeRounding &&
368  m_PaddingMethod == rhs.m_PaddingMethod &&
369  m_DataLayout == rhs.m_DataLayout;
370  }
371 
372  /// The pooling algorithm to use (Max. Average, L2).
374  /// Padding left value in the width dimension.
375  uint32_t m_PadLeft;
376  /// Padding right value in the width dimension.
377  uint32_t m_PadRight;
378  /// Padding top value in the height dimension.
379  uint32_t m_PadTop;
380  /// Padding bottom value in the height dimension.
381  uint32_t m_PadBottom;
382  /// Pooling width value.
383  uint32_t m_PoolWidth;
384  /// Pooling height value.
385  uint32_t m_PoolHeight;
386  /// Stride value when proceeding through input for the width dimension.
387  uint32_t m_StrideX;
388  /// Stride value when proceeding through input for the height dimension.
389  uint32_t m_StrideY;
390  /// The rounding method for the output shape. (Floor, Ceiling).
392  /// The padding method to be used. (Exclude, IgnoreValue).
394  /// The data layout to be used (NCHW, NHWC).
396 };
397 
398 /// A Pooling3dDescriptor for the Pooling3dLayer.
400 {
402  : m_PoolType(PoolingAlgorithm::Max)
403  , m_PadLeft(0)
404  , m_PadRight(0)
405  , m_PadTop(0)
406  , m_PadBottom(0)
407  , m_PadFront(0)
408  , m_PadBack(0)
409  , m_PoolWidth(0)
410  , m_PoolHeight(0)
411  , m_PoolDepth(0)
412  , m_StrideX(0)
413  , m_StrideY(0)
414  , m_StrideZ(0)
415  , m_OutputShapeRounding(OutputShapeRounding::Floor)
416  , m_PaddingMethod(PaddingMethod::Exclude)
417  , m_DataLayout(DataLayout::NCDHW)
418  {}
419 
420  bool operator ==(const Pooling3dDescriptor& rhs) const
421  {
422  return m_PoolType == rhs.m_PoolType &&
423  m_PadLeft == rhs.m_PadLeft &&
424  m_PadRight == rhs.m_PadRight &&
425  m_PadTop == rhs.m_PadTop &&
426  m_PadBottom == rhs.m_PadBottom &&
427  m_PadFront == rhs.m_PadFront &&
428  m_PadBack == rhs.m_PadBack &&
429  m_PoolWidth == rhs.m_PoolWidth &&
430  m_PoolHeight == rhs.m_PoolHeight &&
431  m_PoolDepth == rhs.m_PoolDepth &&
432  m_StrideX == rhs.m_StrideX &&
433  m_StrideY == rhs.m_StrideY &&
434  m_StrideZ == rhs.m_StrideZ &&
435  m_OutputShapeRounding == rhs.m_OutputShapeRounding &&
436  m_PaddingMethod == rhs.m_PaddingMethod &&
437  m_DataLayout == rhs.m_DataLayout;
438  }
439 
440  /// The pooling algorithm to use (Max. Average, L2).
442  /// Padding left value in the width dimension.
443  uint32_t m_PadLeft;
444  /// Padding right value in the width dimension.
445  uint32_t m_PadRight;
446  /// Padding top value in the height dimension.
447  uint32_t m_PadTop;
448  /// Padding bottom value in the height dimension.
449  uint32_t m_PadBottom;
450  /// Padding front value in the depth dimension.
451  uint32_t m_PadFront;
452  /// Padding back value in the depth dimension.
453  uint32_t m_PadBack;
454  /// Pooling width value.
455  uint32_t m_PoolWidth;
456  /// Pooling height value.
457  uint32_t m_PoolHeight;
458  /// Pooling depth value.
459  uint32_t m_PoolDepth;
460  /// Stride value when proceeding through input for the width dimension.
461  uint32_t m_StrideX;
462  /// Stride value when proceeding through input for the height dimension.
463  uint32_t m_StrideY;
464  /// Stride value when proceeding through input for the depth dimension.
465  uint32_t m_StrideZ;
466  /// The rounding method for the output shape. (Floor, Ceiling).
468  /// The padding method to be used. (Exclude, IgnoreValue).
470  /// The data layout to be used (NCDHW, NDHWC).
472 };
473 
474 /// A FullyConnectedDescriptor for the FullyConnectedLayer.
476 {
478  : m_BiasEnabled(false)
479  , m_TransposeWeightMatrix(false)
480  , m_ConstantWeights(true)
481  {}
482 
483  bool operator ==(const FullyConnectedDescriptor& rhs) const
484  {
485  return m_BiasEnabled == rhs.m_BiasEnabled
486  && m_TransposeWeightMatrix == rhs.m_TransposeWeightMatrix
487  && m_ConstantWeights == rhs.m_ConstantWeights;
488  }
489 
490  /// Get the number of inputs.
491  uint32_t GetNumInputs() const;
492 
493  /// Enable/disable bias.
495  /// Enable/disable transpose weight matrix.
497  /// Enable/disable constant weights and biases.
499 };
500 
501 /// A Convolution2dDescriptor for the Convolution2dLayer.
503 {
505  : m_PadLeft(0)
506  , m_PadRight(0)
507  , m_PadTop(0)
508  , m_PadBottom(0)
509  , m_StrideX(1)
510  , m_StrideY(1)
511  , m_DilationX(1)
512  , m_DilationY(1)
513  , m_BiasEnabled(false)
514  , m_DataLayout(DataLayout::NCHW)
515  {}
516 
517  bool operator ==(const Convolution2dDescriptor& rhs) const
518  {
519  return m_PadLeft == rhs.m_PadLeft &&
520  m_PadRight == rhs.m_PadRight &&
521  m_PadTop == rhs.m_PadTop &&
522  m_PadBottom == rhs.m_PadBottom &&
523  m_StrideX == rhs.m_StrideX &&
524  m_StrideY == rhs.m_StrideY &&
525  m_DilationX == rhs.m_DilationX &&
526  m_DilationY == rhs.m_DilationY &&
527  m_BiasEnabled == rhs.m_BiasEnabled &&
528  m_DataLayout == rhs.m_DataLayout;
529  }
530  uint32_t GetNumInputs() const;
531 
532 
533  /// Padding left value in the width dimension.
534  uint32_t m_PadLeft;
535  /// Padding right value in the width dimension.
536  uint32_t m_PadRight;
537  /// Padding top value in the height dimension.
538  uint32_t m_PadTop;
539  /// Padding bottom value in the height dimension.
540  uint32_t m_PadBottom;
541  /// Stride value when proceeding through input for the width dimension.
542  uint32_t m_StrideX;
543  /// Stride value when proceeding through input for the height dimension.
544  uint32_t m_StrideY;
545  /// Dilation along x axis
546  uint32_t m_DilationX;
547  /// Dilation along y axis
548  uint32_t m_DilationY;
549  /// Enable/disable bias.
551  /// The data layout to be used (NCHW, NHWC).
553 };
554 
555 /// A Convolution3dDescriptor for the Convolution3dLayer.
557 {
559  : m_PadLeft(0)
560  , m_PadRight(0)
561  , m_PadTop(0)
562  , m_PadBottom(0)
563  , m_PadFront(0)
564  , m_PadBack(0)
565  , m_StrideX(1)
566  , m_StrideY(1)
567  , m_StrideZ(1)
568  , m_DilationX(1)
569  , m_DilationY(1)
570  , m_DilationZ(1)
571  , m_BiasEnabled(false)
572  , m_DataLayout(DataLayout::NDHWC)
573  {}
574 
575  bool operator ==(const Convolution3dDescriptor& rhs) const
576  {
577  return m_PadLeft == rhs.m_PadLeft &&
578  m_PadRight == rhs.m_PadRight &&
579  m_PadTop == rhs.m_PadTop &&
580  m_PadBottom == rhs.m_PadBottom &&
581  m_PadFront == rhs.m_PadFront &&
582  m_PadBack == rhs.m_PadBack &&
583  m_StrideX == rhs.m_StrideX &&
584  m_StrideY == rhs.m_StrideY &&
585  m_StrideZ == rhs.m_StrideZ &&
586  m_DilationX == rhs.m_DilationX &&
587  m_DilationY == rhs.m_DilationY &&
588  m_DilationZ == rhs.m_DilationZ &&
589  m_BiasEnabled == rhs.m_BiasEnabled &&
590  m_DataLayout == rhs.m_DataLayout;
591  }
592 
593  /// Get the number of views/inputs.
594  uint32_t GetNumInputs() const;
595 
596  /// Padding left value in the width dimension.
597  uint32_t m_PadLeft;
598  /// Padding right value in the width dimension.
599  uint32_t m_PadRight;
600  /// Padding top value in the height dimension.
601  uint32_t m_PadTop;
602  /// Padding bottom value in the height dimension.
603  uint32_t m_PadBottom;
604  /// Padding front value in the depth dimension.
605  uint32_t m_PadFront;
606  /// Padding back value in the depth dimension.
607  uint32_t m_PadBack;
608  /// Stride value when proceeding through input for the width dimension.
609  uint32_t m_StrideX;
610  /// Stride value when proceeding through input for the height dimension.
611  uint32_t m_StrideY;
612  /// Stride value when proceeding through input for the depth dimension.
613  uint32_t m_StrideZ;
614  /// Dilation along x axis
615  uint32_t m_DilationX;
616  /// Dilation along y axis
617  uint32_t m_DilationY;
618  /// Dilation along z axis
619  uint32_t m_DilationZ;
620  /// Enable/disable bias.
622  /// The data layout to be used (NDHWC, NCDHW).
624 };
625 
626 /// A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
628 {
630  : m_PadLeft(0)
631  , m_PadRight(0)
632  , m_PadTop(0)
633  , m_PadBottom(0)
634  , m_StrideX(1)
635  , m_StrideY(1)
636  , m_DilationX(1)
637  , m_DilationY(1)
638  , m_BiasEnabled(false)
639  , m_DataLayout(DataLayout::NCHW)
640  {}
641 
643  {
644  return m_PadLeft == rhs.m_PadLeft &&
645  m_PadRight == rhs.m_PadRight &&
646  m_PadTop == rhs.m_PadTop &&
647  m_PadBottom == rhs.m_PadBottom &&
648  m_StrideX == rhs.m_StrideX &&
649  m_StrideY == rhs.m_StrideY &&
650  m_DilationX == rhs.m_DilationX &&
651  m_DilationY == rhs.m_DilationY &&
652  m_BiasEnabled == rhs.m_BiasEnabled &&
653  m_DataLayout == rhs.m_DataLayout;
654  }
655 
656  /// Get the number of views/inputs.
657  uint32_t GetNumInputs() const;
658 
659  /// Padding left value in the width dimension.
660  uint32_t m_PadLeft;
661  /// Padding right value in the width dimension.
662  uint32_t m_PadRight;
663  /// Padding top value in the height dimension.
664  uint32_t m_PadTop;
665  /// Padding bottom value in the height dimension.
666  uint32_t m_PadBottom;
667  /// Stride value when proceeding through input for the width dimension.
668  uint32_t m_StrideX;
669  /// Stride value when proceeding through input for the height dimension.
670  uint32_t m_StrideY;
671  /// Dilation factor value for width dimension.
672  uint32_t m_DilationX;
673  /// Dilation factor value for height dimension.
674  uint32_t m_DilationY;
675  /// Enable/disable bias.
677  /// The data layout to be used (NCHW, NHWC).
679 };
680 
682 {
684  : m_MaxDetections(0)
685  , m_MaxClassesPerDetection(1)
686  , m_DetectionsPerClass(1)
687  , m_NmsScoreThreshold(0)
688  , m_NmsIouThreshold(0)
689  , m_NumClasses(0)
690  , m_UseRegularNms(false)
691  , m_ScaleX(0)
692  , m_ScaleY(0)
693  , m_ScaleW(0)
694  , m_ScaleH(0)
695  {}
696 
698  {
699  return m_MaxDetections == rhs.m_MaxDetections &&
700  m_MaxClassesPerDetection == rhs.m_MaxClassesPerDetection &&
701  m_DetectionsPerClass == rhs.m_DetectionsPerClass &&
702  m_NmsScoreThreshold == rhs.m_NmsScoreThreshold &&
703  m_NmsIouThreshold == rhs.m_NmsIouThreshold &&
704  m_NumClasses == rhs.m_NumClasses &&
705  m_UseRegularNms == rhs.m_UseRegularNms &&
706  m_ScaleX == rhs.m_ScaleX &&
707  m_ScaleY == rhs.m_ScaleY &&
708  m_ScaleW == rhs.m_ScaleW &&
709  m_ScaleH == rhs.m_ScaleH;
710  }
711 
712  /// Maximum numbers of detections.
713  uint32_t m_MaxDetections;
714  /// Maximum numbers of classes per detection, used in Fast NMS.
716  /// Detections per classes, used in Regular NMS.
718  /// NMS score threshold.
720  /// Intersection over union threshold.
722  /// Number of classes.
723  uint32_t m_NumClasses;
724  /// Use Regular NMS.
726  /// Center size encoding scale x.
727  float m_ScaleX;
728  /// Center size encoding scale y.
729  float m_ScaleY;
730  /// Center size encoding scale weight.
731  float m_ScaleW;
732  /// Center size encoding scale height.
733  float m_ScaleH;
734 };
735 
736 /// A NormalizationDescriptor for the NormalizationLayer.
738 {
740  : m_NormChannelType(NormalizationAlgorithmChannel::Across)
741  , m_NormMethodType(NormalizationAlgorithmMethod::LocalBrightness)
742  , m_NormSize(0)
743  , m_Alpha(0.f)
744  , m_Beta(0.f)
745  , m_K(0.f)
746  , m_DataLayout(DataLayout::NCHW)
747  {}
748 
749  bool operator ==(const NormalizationDescriptor& rhs) const
750  {
751  return m_NormChannelType == rhs.m_NormChannelType &&
752  m_NormMethodType == rhs.m_NormMethodType &&
753  m_NormSize == rhs.m_NormSize &&
754  m_Alpha == rhs.m_Alpha &&
755  m_Beta == rhs.m_Beta &&
756  m_K == rhs.m_K &&
757  m_DataLayout == rhs.m_DataLayout;
758  }
759 
760  /// Normalization channel algorithm to use (Across, Within).
762  /// Normalization method algorithm to use (LocalBrightness, LocalContrast).
764  /// Depth radius value.
765  uint32_t m_NormSize;
766  /// Alpha value for the normalization equation.
767  float m_Alpha;
768  /// Beta value for the normalization equation.
769  float m_Beta;
770  /// Kappa value used for the across channel normalization equation.
771  float m_K;
772  /// The data layout to be used (NCHW, NHWC).
774 };
775 
776 /// A L2NormalizationDescriptor for the L2NormalizationLayer.
778 {
780  : m_Eps(1e-12f)
781  , m_DataLayout(DataLayout::NCHW)
782  {}
783 
784  bool operator ==(const L2NormalizationDescriptor& rhs) const
785  {
786  return m_Eps == rhs.m_Eps && m_DataLayout == rhs.m_DataLayout;
787  }
788 
789  /// Used to avoid dividing by zero.
790  float m_Eps;
791  /// The data layout to be used (NCHW, NHWC).
793 };
794 
795 /// A BatchNormalizationDescriptor for the BatchNormalizationLayer.
797 {
799  : m_Eps(0.0001f)
800  , m_DataLayout(DataLayout::NCHW)
801  {}
802 
804  {
805  return m_Eps == rhs.m_Eps && m_DataLayout == rhs.m_DataLayout;
806  }
807 
808  /// Value to add to the variance. Used to avoid dividing by zero.
809  float m_Eps;
810  /// The data layout to be used (NCHW, NHWC).
812 };
813 
814 /// An InstanceNormalizationDescriptor for InstanceNormalizationLayer
816 {
818  : m_Gamma(1.0f)
819  , m_Beta(0.0f)
820  , m_Eps(1e-12f)
821  , m_DataLayout(DataLayout::NCHW)
822  {}
823 
825  {
826  return m_Gamma == rhs.m_Gamma &&
827  m_Beta == rhs.m_Beta &&
828  m_Eps == rhs.m_Eps &&
829  m_DataLayout == rhs.m_DataLayout;
830  }
831 
832  /// Gamma, the scale scalar value applied for the normalized tensor. Defaults to 1.0.
833  float m_Gamma;
834  /// Beta, the offset scalar value applied for the normalized tensor. Defaults to 1.0.
835  float m_Beta;
836  /// Epsilon, small scalar value added to variance to avoid dividing by zero. Defaults to 1e-12f.
837  float m_Eps;
838  /// The data layout to be used (NCHW, NHWC).
840 };
841 
842 /// A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
844 {
846  : m_BlockShape({1, 1})
847  , m_Crops({{0, 0}, {0, 0}})
848  , m_DataLayout(DataLayout::NCHW)
849  {}
850 
851  BatchToSpaceNdDescriptor(std::vector<unsigned int> blockShape,
852  std::vector<std::pair<unsigned int, unsigned int>> crops)
853  : m_BlockShape(blockShape)
854  , m_Crops(crops)
855  , m_DataLayout(DataLayout::NCHW)
856  {}
857 
858  bool operator ==(const BatchToSpaceNdDescriptor& rhs) const
859  {
860  return m_BlockShape == rhs.m_BlockShape &&
861  m_Crops == rhs.m_Crops &&
862  m_DataLayout == rhs.m_DataLayout;
863  }
864 
865  /// Block shape values.
866  std::vector<unsigned int> m_BlockShape;
867  /// The values to crop from the input dimension.
868  std::vector<std::pair<unsigned int, unsigned int>> m_Crops;
869  /// The data layout to be used (NCHW, NHWC).
871 };
872 
873 /// A FakeQuantizationDescriptor for the FakeQuantizationLayer.
875 {
877  : m_Min(-6.0f)
878  , m_Max(6.0f)
879  {}
880 
882  {
883  return m_Min == rhs.m_Min && m_Max == rhs.m_Max;
884  }
885 
886  /// Minimum value.
887  float m_Min;
888  /// Maximum value.
889  float m_Max;
890 };
891 
892 /// A FillDescriptor for the FillLayer
894 {
896  : m_Value(0)
897  {}
898 
899  FillDescriptor(const float& value)
900  : m_Value(value)
901  {}
902 
903  bool operator ==(const FillDescriptor& rhs) const
904  {
905  return m_Value == rhs.m_Value;
906  }
907 
908  float m_Value;
909 };
910 
911 /// A GatherDescriptor for the GatherLayer.
913 {
915  : m_Axis(0)
916  {}
917 
918  GatherDescriptor(int32_t axis)
919  : m_Axis(axis)
920  {}
921 
922  bool operator ==(const GatherDescriptor& rhs) const
923  {
924  return m_Axis == rhs.m_Axis;
925  }
926 
927  /// The axis in params to gather indices from
928  int32_t m_Axis;
929 };
930 
931 /// A ResizeDescriptor for the ResizeLayer.
933 {
935  : m_TargetWidth(0)
936  , m_TargetHeight(0)
937  , m_Method(ResizeMethod::NearestNeighbor)
938  , m_DataLayout(DataLayout::NCHW)
939  , m_AlignCorners(false)
940  , m_HalfPixelCenters(false)
941  {}
942 
943  bool operator ==(const ResizeDescriptor& rhs) const
944  {
945  return m_TargetWidth == rhs.m_TargetWidth &&
946  m_TargetHeight == rhs.m_TargetHeight &&
947  m_Method == rhs.m_Method &&
948  m_DataLayout == rhs.m_DataLayout &&
949  m_AlignCorners == rhs.m_AlignCorners &&
950  m_HalfPixelCenters == rhs.m_HalfPixelCenters;
951  }
952 
953  /// Target width value.
954  uint32_t m_TargetWidth;
955  /// Target height value.
956  uint32_t m_TargetHeight;
957  /// The Interpolation method to use
958  /// (Bilinear, NearestNeighbor).
960  /// The data layout to be used (NCHW, NHWC).
962  /// Aligned corners
964  /// Half Pixel Centers
966 };
967 
968 
969 /// A ReshapeDescriptor for the ReshapeLayer.
971 {
973  : m_TargetShape()
974  {}
975 
977  : m_TargetShape(shape)
978  {}
979 
980  bool operator ==(const ReshapeDescriptor& rhs) const
981  {
982  return m_TargetShape == rhs.m_TargetShape;
983  }
984 
985  /// Target shape value.
987 };
988 
989 /// A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
991 {
993  : m_BlockShape({1, 1})
994  , m_PadList({{0, 0}, {0, 0}})
995  , m_DataLayout(DataLayout::NCHW)
996  {}
997 
998  SpaceToBatchNdDescriptor(const std::vector<unsigned int>& blockShape,
999  const std::vector<std::pair<unsigned int, unsigned int>>& padList)
1000  : m_BlockShape(blockShape)
1001  , m_PadList(padList)
1002  , m_DataLayout(DataLayout::NCHW)
1003  {}
1004 
1005  bool operator ==(const SpaceToBatchNdDescriptor& rhs) const
1006  {
1007  return m_BlockShape == rhs.m_BlockShape &&
1008  m_PadList == rhs.m_PadList &&
1009  m_DataLayout == rhs.m_DataLayout;
1010  }
1011 
1012  /// Block shape value.
1013  std::vector<unsigned int> m_BlockShape;
1014  /// @brief Specifies the padding values for the input dimension:
1015  /// heightPad{top, bottom} widthPad{left, right}.
1016  std::vector<std::pair<unsigned int, unsigned int>> m_PadList;
1017  /// The data layout to be used (NCHW, NHWC).
1019 };
1020 
1021 /// A SpaceToDepthDescriptor for the SpaceToDepthLayer
1023 {
1026  {}
1027 
1028  SpaceToDepthDescriptor(unsigned int blockSize, DataLayout dataLayout)
1029  : m_BlockSize(blockSize)
1030  , m_DataLayout(dataLayout)
1031  {}
1032 
1033  bool operator ==(const SpaceToDepthDescriptor& rhs) const
1034  {
1035  return m_BlockSize == rhs.m_BlockSize && m_DataLayout == rhs.m_DataLayout;
1036  }
1037 
1038  /// Scalar specifying the input block size. It must be >= 1
1039  unsigned int m_BlockSize;
1040 
1041  /// The data layout to be used (NCHW, NHWC).
1043 };
1044 
1045 /// A DepthToSpaceDescriptor for the DepthToSpaceLayer
1047 
1048 /// An LstmDescriptor for the LstmLayer.
1050 {
1052  : m_ActivationFunc(1) // 0: None, 1: Relu, 3: Relu6, 4: Tanh, 6: Sigmoid
1053  , m_ClippingThresCell(0.0)
1054  , m_ClippingThresProj(0.0)
1055  , m_CifgEnabled(true)
1056  , m_PeepholeEnabled(false)
1057  , m_ProjectionEnabled(false)
1058  , m_LayerNormEnabled(false)
1059  , m_TimeMajor(false)
1060  , m_InputIntermediateScale(0.0)
1061  , m_ForgetIntermediateScale(0.0)
1062  , m_CellIntermediateScale(0.0)
1063  , m_OutputIntermediateScale(0.0)
1064  , m_HiddenStateZeroPoint(0)
1065  , m_HiddenStateScale(0.0)
1066  {}
1067 
1068  bool operator ==(const LstmDescriptor& rhs) const
1069  {
1070  return m_ActivationFunc == rhs.m_ActivationFunc &&
1071  m_ClippingThresCell == rhs.m_ClippingThresCell &&
1072  m_ClippingThresProj == rhs.m_ClippingThresProj &&
1073  m_CifgEnabled == rhs.m_CifgEnabled &&
1074  m_PeepholeEnabled == rhs.m_PeepholeEnabled &&
1075  m_LayerNormEnabled == rhs.m_LayerNormEnabled &&
1076  m_TimeMajor == rhs.m_TimeMajor &&
1077  m_InputIntermediateScale == rhs.m_InputIntermediateScale &&
1078  m_ForgetIntermediateScale == rhs.m_ForgetIntermediateScale &&
1079  m_CellIntermediateScale == rhs.m_CellIntermediateScale &&
1080  m_OutputIntermediateScale == rhs.m_OutputIntermediateScale &&
1081  m_HiddenStateZeroPoint == rhs.m_HiddenStateZeroPoint &&
1082  m_HiddenStateScale == rhs.m_HiddenStateScale;
1083  }
1084 
1085  /// @brief The activation function to use.
1086  /// 0: None, 1: Relu, 3: Relu6, 4: Tanh, 6: Sigmoid.
1088  /// Clipping threshold value for the cell state.
1090  /// Clipping threshold value for the projection.
1092  /// Enable/disable cifg (coupled input & forget gate).
1094  /// Enable/disable peephole.
1096  /// Enable/disable the projection layer.
1098  /// Enable/disable layer normalization
1100  /// Enable/disable time major
1102  /// Input intermediate quantization scale
1104  /// Forget intermediate quantization scale
1106  /// Cell intermediate quantization scale
1108  /// Output intermediate quantization scale
1110  /// Hidden State zero point
1112  /// Hidden State quantization scale
1114 };
1115 
1117 
1118 /// A MeanDescriptor for the MeanLayer.
1120 {
1122  : m_Axis()
1123  , m_KeepDims(false)
1124  {}
1125 
1126  MeanDescriptor(const std::vector<unsigned int>& axis, bool keepDims)
1127  : m_Axis(axis)
1128  , m_KeepDims(keepDims)
1129  {}
1130 
1131  bool operator ==(const MeanDescriptor& rhs) const
1132  {
1133  return m_Axis == rhs.m_Axis && m_KeepDims == rhs.m_KeepDims;
1134  }
1135 
1136  /// Values for the dimensions to reduce.
1137  std::vector<unsigned int> m_Axis;
1138  /// Enable/disable keep dimensions. If true, then the reduced dimensions that are of length 1 are kept.
1140 };
1141 
1142 /// A PadDescriptor for the PadLayer.
1144 {
1145  PadDescriptor() : m_PadValue(0), m_PaddingMode(PaddingMode::Constant)
1146  {}
1147 
1148  PadDescriptor(const std::vector<std::pair<unsigned int, unsigned int>>& padList,
1149  const float& padValue = 0,
1150  const PaddingMode& paddingMode = PaddingMode::Constant)
1151  : m_PadList(padList)
1152  , m_PadValue(padValue)
1153  , m_PaddingMode(paddingMode)
1154  {}
1155 
1156  bool operator ==(const PadDescriptor& rhs) const
1157  {
1158  return m_PadList == rhs.m_PadList && m_PadValue == rhs.m_PadValue && m_PaddingMode == rhs.m_PaddingMode;
1159  }
1160 
1161  /// @brief Specifies the padding for input dimension.
1162  /// First is the number of values to add before the tensor in the dimension.
1163  /// Second is the number of values to add after the tensor in the dimension.
1164  /// The number of pairs should match the number of dimensions in the input tensor.
1165  std::vector<std::pair<unsigned int, unsigned int>> m_PadList;
1166 
1167  /// Optional value to use for padding, defaults to 0
1168  float m_PadValue;
1169 
1170  /// Specifies the Padding mode (Constant, Reflect or Symmetric)
1172 };
1173 
1174 /// A SliceDescriptor for the SliceLayer.
1176 {
1177  SliceDescriptor(const std::vector<unsigned int>& begin, const std::vector<unsigned int>& size)
1178  : m_Begin(begin)
1179  , m_Size(size)
1180  {}
1181 
1183  {}
1184 
1185  bool operator ==(const SliceDescriptor& rhs) const
1186  {
1187  return m_Begin == rhs.m_Begin && m_Size == rhs.m_Size;
1188  }
1189 
1190  /// Beginning indices of the slice in each dimension.
1191  std::vector<unsigned int> m_Begin;
1192 
1193  /// Size of the slice in each dimension.
1194  std::vector<unsigned int> m_Size;
1195 };
1196 
1197 /// A StackDescriptor for the StackLayer.
1199 {
1201  : m_Axis(0)
1202  , m_NumInputs(0)
1203  , m_InputShape()
1204  {}
1205 
1206  StackDescriptor(uint32_t axis, uint32_t numInputs, const TensorShape& inputShape)
1207  : m_Axis(axis)
1208  , m_NumInputs(numInputs)
1209  , m_InputShape(inputShape)
1210  {}
1211 
1212  bool operator ==(const StackDescriptor& rhs) const
1213  {
1214  return m_Axis == rhs.m_Axis &&
1215  m_NumInputs == rhs.m_NumInputs &&
1216  m_InputShape == rhs.m_InputShape;
1217  }
1218 
1219  /// 0-based axis along which to stack the input tensors.
1220  uint32_t m_Axis;
1221  /// Number of input tensors.
1222  uint32_t m_NumInputs;
1223  /// Required shape of all input tensors.
1225 };
1226 
1227 /// A StandInDescriptor for the StandIn layer
1229 {
1231 
1232  StandInDescriptor(uint32_t numInputs, uint32_t numOutputs)
1233  : m_NumInputs(numInputs)
1234  , m_NumOutputs(numOutputs)
1235  {}
1236 
1237  bool operator ==(const StandInDescriptor& rhs) const
1238  {
1239  return m_NumInputs == rhs.m_NumInputs &&
1240  m_NumOutputs == rhs.m_NumOutputs;
1241  }
1242 
1243  /// Number of input tensors
1244  uint32_t m_NumInputs = 0;
1245  /// Number of output tensors
1246  uint32_t m_NumOutputs = 0;
1247 };
1248 
1249 /// A StridedSliceDescriptor for the StridedSliceLayer.
1251 {
1252  StridedSliceDescriptor(const std::vector<int>& begin,
1253  const std::vector<int>& end,
1254  const std::vector<int>& stride)
1255  : m_Begin(begin)
1256  , m_End(end)
1257  , m_Stride(stride)
1258  , m_BeginMask(0)
1259  , m_EndMask(0)
1260  , m_ShrinkAxisMask(0)
1261  , m_EllipsisMask(0)
1262  , m_NewAxisMask(0)
1263  , m_DataLayout(DataLayout::NCHW)
1264  {}
1265 
1267  : StridedSliceDescriptor({}, {}, {})
1268  {}
1269 
1270  bool operator ==(const StridedSliceDescriptor& rhs) const
1271  {
1272  return m_Begin == rhs.m_Begin &&
1273  m_End == rhs.m_End &&
1274  m_Stride == rhs.m_Stride &&
1275  m_BeginMask == rhs.m_BeginMask &&
1276  m_EndMask == rhs.m_EndMask &&
1277  m_ShrinkAxisMask == rhs.m_ShrinkAxisMask &&
1278  m_EllipsisMask == rhs.m_EllipsisMask &&
1279  m_NewAxisMask == rhs.m_NewAxisMask &&
1280  m_DataLayout == rhs.m_DataLayout;
1281  }
1282 
1283  int GetStartForAxis(const TensorShape& inputShape, unsigned int axis) const;
1284  int GetStopForAxis(const TensorShape& inputShape,
1285  unsigned int axis,
1286  int startForAxis) const;
1287 
1288  /// Begin values for the input that will be sliced.
1289  std::vector<int> m_Begin;
1290  /// End values for the input that will be sliced.
1291  std::vector<int> m_End;
1292  /// Stride values for the input that will be sliced.
1293  std::vector<int> m_Stride;
1294 
1295  /// @brief Begin mask value. If set, then the begin is disregarded and the fullest
1296  /// range is used for the dimension.
1297  int32_t m_BeginMask;
1298  /// @brief End mask value. If set, then the end is disregarded and the fullest range
1299  /// is used for the dimension.
1300  int32_t m_EndMask;
1301  /// Shrink axis mask value. If set, the nth specification shrinks the dimensionality by 1.
1303  /// Ellipsis mask value.
1305  /// @brief New axis mask value. If set, the begin, end and stride is disregarded and
1306  /// a new 1 dimension is inserted to this location of the output tensor.
1307  int32_t m_NewAxisMask;
1308 
1309  /// The data layout to be used (NCHW, NHWC).
1311 };
1312 
1313 /// A PreCompiledDescriptor for the PreCompiledLayer.
1315 {
1316  PreCompiledDescriptor(unsigned int numInputSlots = 1u, unsigned int numOutputSlots = 1u)
1317  : m_NumInputSlots(numInputSlots), m_NumOutputSlots(numOutputSlots)
1318  {}
1319 
1320  ~PreCompiledDescriptor() = default;
1321 
1322  unsigned int m_NumInputSlots;
1323  unsigned int m_NumOutputSlots;
1324 };
1325 
1326 /// A QLstmDescriptor for the QLstmLayer.
1328 {
1330  : m_CellClip(0.0)
1331  , m_ProjectionClip(0.0)
1332  , m_CifgEnabled(true)
1333  , m_PeepholeEnabled(false)
1334  , m_ProjectionEnabled(false)
1335  , m_LayerNormEnabled(false)
1336  , m_InputIntermediateScale(0.0)
1337  , m_ForgetIntermediateScale(0.0)
1338  , m_CellIntermediateScale(0.0)
1339  , m_OutputIntermediateScale(0.0)
1340  , m_HiddenStateZeroPoint(0)
1341  , m_HiddenStateScale(0.0)
1342  {}
1343 
1344  bool operator ==(const QLstmDescriptor& rhs) const
1345  {
1346  return m_CellClip == rhs.m_CellClip &&
1347  m_ProjectionClip == rhs.m_ProjectionClip &&
1348  m_CifgEnabled == rhs.m_CifgEnabled &&
1349  m_PeepholeEnabled == rhs.m_PeepholeEnabled &&
1350  m_ProjectionEnabled == rhs.m_ProjectionEnabled &&
1351  m_LayerNormEnabled == rhs.m_LayerNormEnabled &&
1352  m_InputIntermediateScale == rhs.m_InputIntermediateScale &&
1353  m_ForgetIntermediateScale == rhs.m_ForgetIntermediateScale &&
1354  m_CellIntermediateScale == rhs.m_CellIntermediateScale &&
1355  m_OutputIntermediateScale == rhs.m_OutputIntermediateScale &&
1356  m_HiddenStateZeroPoint == rhs.m_HiddenStateZeroPoint &&
1357  m_HiddenStateScale == rhs.m_HiddenStateScale;
1358  }
1359 
1360  /// Clipping threshold value for the cell state
1361  float m_CellClip;
1362  /// Clipping threshold value for the projection
1364  /// Enable/disable CIFG (coupled input & forget gate).
1366  /// Enable/disable peephole
1368  /// Enable/disable the projection layer
1370  /// Enable/disable layer normalization
1372  /// Input intermediate quantization scale
1374  /// Forget intermediate quantization scale
1376  /// Cell intermediate quantization scale
1378  /// Output intermediate quantization scale
1380  /// Hidden State zero point
1382  /// Hidden State quantization scale
1384 };
1385 
1386 /// A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
1388 {
1390  m_PadLeft(0),
1391  m_PadRight(0),
1392  m_PadTop(0),
1393  m_PadBottom(0),
1394  m_StrideX(0),
1395  m_StrideY(0),
1396  m_BiasEnabled(false),
1397  m_DataLayout(DataLayout::NCHW),
1398  m_OutputShapeEnabled(false)
1399  {}
1400 
1402  {
1403  return m_PadLeft == rhs.m_PadLeft &&
1404  m_PadRight == rhs.m_PadRight &&
1405  m_PadTop == rhs.m_PadTop &&
1406  m_PadBottom == rhs.m_PadBottom &&
1407  m_StrideX == rhs.m_StrideX &&
1408  m_StrideY == rhs.m_StrideY &&
1409  m_BiasEnabled == rhs.m_BiasEnabled &&
1410  m_DataLayout == rhs.m_DataLayout &&
1411  m_OutputShapeEnabled == rhs.m_OutputShapeEnabled &&
1412  m_OutputShape == rhs.m_OutputShape;
1413  }
1414 
1415  /// Padding left value in the width dimension.
1416  uint32_t m_PadLeft;
1417  /// Padding right value in the width dimension.
1418  uint32_t m_PadRight;
1419  /// Padding top value in the height dimension.
1420  uint32_t m_PadTop;
1421  /// Padding bottom value in the height dimension.
1422  uint32_t m_PadBottom;
1423  /// Stride value when proceeding through input for the width dimension.
1424  uint32_t m_StrideX;
1425  /// Stride value when proceeding through input for the height dimension.
1426  uint32_t m_StrideY;
1427  /// Enable/disable bias.
1429  /// The data layout to be used (NCHW, NHWC).
1431  /// Output shape if it has been specified.
1433  std::vector<unsigned int> m_OutputShape;
1434 };
1435 
1436 /// A TransposeDescriptor for the TransposeLayer.
1438 {
1440  : m_DimMappings{}
1441  {}
1442 
1444  : m_DimMappings(dimMappings)
1445  {}
1446 
1447  bool operator ==(const TransposeDescriptor &rhs) const
1448  {
1449  return m_DimMappings.IsEqual(rhs.m_DimMappings);
1450  }
1451 
1452  /// @brief Indicates how to translate tensor elements from a given source into the target destination, when
1453  /// source and target potentially have different memory layouts e.g.
1454  /// Input Shape {1, 1, 4, 4}
1455  /// Permutation Vector {0, 2, 3, 1}
1456  /// Output Shape {1, 4, 4, 1}
1457  /// dim "0" of input goes into index 0 ([ 1, X, X, X])
1458  /// dim "2" of input goes into index 1 ([ 1, 4, X, X ])
1459  /// dim "3" of input goes into index 2 ([ 1, 4, 4, X ])
1460  /// dim "1" of input goes into index 3 ([ 1, 4, 4, 1 ])
1462 };
1463 
1464 /// A LogicalBinaryDescriptor for the LogicalBinaryLayer
1466 {
1469  {}
1470 
1472  : m_Operation(operation)
1473  {}
1474 
1475  bool operator ==(const LogicalBinaryDescriptor &rhs) const
1476  {
1477  return m_Operation == rhs.m_Operation;
1478  }
1479 
1480  /// Specifies the logical operation to execute
1482 };
1483 
1484 /// A ReduceDescriptor for the REDUCE operators.
1486 {
1488  : m_KeepDims(false)
1489  , m_vAxis()
1490  , m_ReduceOperation(ReduceOperation::Sum)
1491  {}
1492 
1493  bool operator ==(const ReduceDescriptor& rhs) const
1494  {
1495  return m_KeepDims == rhs.m_KeepDims &&
1496  m_vAxis == rhs.m_vAxis &&
1497  m_ReduceOperation == rhs.m_ReduceOperation;
1498  }
1499 
1500  /// if true then output shape has no change.
1502  /// The indices of the dimensions to reduce.
1503  std::vector<uint32_t> m_vAxis;
1504  /// Specifies the reduction operation to execute
1506 };
1507 
1508 /// A ChannelShuffleDescriptor for the ChannelShuffle operator
1510 {
1512  : m_NumGroups(0), m_Axis(0)
1513  {}
1514 
1515  ChannelShuffleDescriptor(const uint32_t& numGroups, const uint32_t& axis)
1516  : m_NumGroups(numGroups), m_Axis(axis)
1517  {}
1518 
1519  bool operator ==(const ChannelShuffleDescriptor& rhs) const
1520  {
1521  return m_NumGroups == rhs.m_NumGroups;
1522  }
1523 
1524  /// Number of groups for the channel shuffle operation
1525  uint32_t m_NumGroups;
1526  /// Axis to apply channel shuffle operation on
1527  uint32_t m_Axis;
1528 };
1529 
1530 /// A BatchMatMulDescriptor for the BatchMatMul operator
1532 {
1533  BatchMatMulDescriptor(bool transposeX = false,
1534  bool transposeY = false,
1535  bool adjointX = false,
1536  bool adjointY = false,
1537  DataLayout dataLayoutX = DataLayout::NCHW,
1538  DataLayout dataLayoutY = DataLayout::NCHW)
1539  : m_TransposeX(transposeX)
1540  , m_TransposeY(transposeY)
1541  , m_AdjointX(adjointX)
1542  , m_AdjointY(adjointY)
1543  , m_DataLayoutX(dataLayoutX)
1544  , m_DataLayoutY(dataLayoutY)
1545  {}
1546 
1547  bool operator ==(const BatchMatMulDescriptor &rhs) const
1548  {
1549  return m_TransposeX == rhs.m_TransposeX &&
1550  m_TransposeY == rhs.m_TransposeY &&
1551  m_AdjointX == rhs.m_AdjointX &&
1552  m_AdjointY == rhs.m_AdjointY &&
1553  m_DataLayoutX == rhs.m_DataLayoutX &&
1554  m_DataLayoutY == rhs.m_DataLayoutY;
1555  }
1556 
1557  /// Transpose the slices of each input tensor
1558  /// Transpose and Adjoint can not both be set to true for the same tensor at the same time
1561 
1562  /// Adjoint the slices of each input tensor
1563  /// Transpose and Adjoint can not both be set to true for the same tensor at the same time
1566 
1567  /// Data layout of each input tensor, such as NHWC/NDHWC (leave as default for arbitrary layout)
1570 
1571  ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This method is deprecated. Use ABI Stable "
1572  "GetAxesToMul(DataLayout dataLayout, const TensorShape& tensorShape) instead.",
1573  "23.05")
1574  static std::pair<std::pair<unsigned int, unsigned int>, std::pair<unsigned int, unsigned int>> GetAxesToMul(
1575  const BatchMatMulDescriptor& desc,
1576  const TensorShape& tensorXShape,
1577  const TensorShape& tensorYShape);
1578 
1579  ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This method is deprecated. Use ABI Stable "
1580  "GetAxesNotMul(DataLayout dataLayout, const TensorShape& tensorShape) instead.",
1581  "23.05")
1582  static std::pair<std::vector<unsigned int>, std::vector<unsigned int>> GetAxesNotMul(
1583  const BatchMatMulDescriptor& desc,
1584  const TensorShape& inputXShape,
1585  const TensorShape& inputYShape);
1586 
1587  /// Static helper to get the two axes (for each input) for multiplication
1588  static std::pair<unsigned int, unsigned int> GetAxesToMul(
1589  DataLayout dataLayout,
1590  const TensorShape& tensorShape);
1591 
1592  /// Static helper to get the axes (for each input) that will not be multiplied together
1593  static std::vector<unsigned int> GetAxesNotMul(
1594  DataLayout dataLayout,
1595  const TensorShape& tensorShape);
1596 
1597  /// Static helper to get the axes which will be transposed
1598  static PermutationVector GetPermuteVec(
1599  DataLayout dataLayout,
1600  const TensorShape& tensorShape);
1601 };
1602 
1603 } // namespace armnn
ElementwiseUnaryDescriptor(UnaryOperation operation)
-
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.
-
MeanDescriptor(const std::vector< unsigned int > &axis, bool keepDims)
- - -
bool m_ProjectionEnabled
Enable/disable the projection layer.
-
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
-
PreCompiledDescriptor(unsigned int numInputSlots=1u, unsigned int numOutputSlots=1u)
- - - -
SliceDescriptor(const std::vector< unsigned int > &begin, const std::vector< unsigned int > &size)
-
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.
-
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.
-
DataLayout
Definition: Types.hpp:62
-
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.
- -
void swap(OriginsDescriptor &first, OriginsDescriptor &second)
-
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.
-
bool IsNull() const override
Definition: Descriptors.hpp:32
-
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).
-
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.
- -
PermuteDescriptor(const PermutationVector &dimMappings)
- -
uint32_t m_PoolWidth
Pooling width value.
-
bool m_PeepholeEnabled
Enable/disable peephole.
-
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.
-
PadDescriptor(const std::vector< std::pair< unsigned int, unsigned int >> &padList, const float &padValue=0, const PaddingMode &paddingMode=PaddingMode::Constant)
-
uint32_t m_PadLeft
Padding left value in the width dimension.
-
bool m_KeepDims
if true then output shape has no change.
-
float m_HiddenStateScale
Hidden State quantization scale.
-
bool m_BiasEnabled
Enable/disable bias.
-
bool m_TransposeX
Transpose the slices of each input tensor Transpose and Adjoint can not both be set to true for the s...
-
std::vector< unsigned int > m_OutputShape
-
float m_OutputIntermediateScale
Output intermediate quantization scale.
-
ResizeMethod m_Method
The Interpolation method to use (Bilinear, NearestNeighbor).
-
float m_Gamma
Gamma, the scale scalar value applied for the normalized tensor. Defaults to 1.0. ...
-
float m_Beta
Exponentiation value.
-
std::vector< unsigned int > m_Size
Size of the slice in each dimension.
-
ActivationDescriptor(armnn::ActivationFunction activation, float a=0, float b=0)
Definition: Descriptors.hpp:44
-
The padding fields don&#39;t count and are ignored.
-
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).
-
ArgMinMaxFunction m_Function
Specify if the function is to find Min or Max.
Definition: Descriptors.hpp:81
-
uint32_t m_DetectionsPerClass
Detections per classes, used in Regular NMS.
-
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
- -
NormalizationAlgorithmChannel
Definition: Types.hpp:193
-
bool m_OutputShapeEnabled
Output shape if it has been specified.
-
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
- - - -
bool m_AdjointX
Adjoint the slices of each input tensor Transpose and Adjoint can not both be set to true for the sam...
-
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.
-
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
- -
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.
-
ReduceOperation m_ReduceOperation
Specifies the reduction operation to execute.
-
bool m_TimeMajor
Enable/disable time major.
-
BatchMatMulDescriptor(bool transposeX=false, bool transposeY=false, bool adjointX=false, bool adjointY=false, DataLayout dataLayoutX=DataLayout::NCHW, DataLayout dataLayoutY=DataLayout::NCHW)
-
ChannelShuffleDescriptor(const uint32_t &numGroups, const uint32_t &axis)
-
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.
- -
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.
-
PoolingAlgorithm
Definition: Types.hpp:136
-
virtual ~BaseDescriptor()=default
-
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.
-
StridedSliceDescriptor(const std::vector< int > &begin, const std::vector< int > &end, const std::vector< int > &stride)
-
LogicalBinaryOperation m_Operation
Specifies the logical operation to execute.
-
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
-
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
-
LogicalBinaryOperation
Definition: Types.hpp:118
-
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.
-
uint32_t m_NumOutputs
Number of output tensors.
-
NormalizationAlgorithmMethod m_NormMethodType
Normalization method algorithm to use (LocalBrightness, LocalContrast).
-
A ResizeDescriptor for the ResizeLayer.
-
PaddingMethod
The padding method modifies the output of pooling layers.
Definition: Types.hpp:174
-
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.
-
Base class for all descriptors.
Definition: Descriptors.hpp:22
-
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).
-
float m_ForgetIntermediateScale
Forget intermediate quantization scale.
- -
TensorShape m_TargetShape
Target shape value.
- -
ComparisonDescriptor(ComparisonOperation operation)
Definition: Descriptors.hpp:95
-
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.
- - -
DataLayout m_DataLayoutX
Data layout of each input tensor, such as NHWC/NDHWC (leave as default for arbitrary layout) ...
-
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
-
int32_t m_HiddenStateZeroPoint
Hidden State zero point.
-
ComparisonOperation
Definition: Types.hpp:108
-
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.
-
ReduceOperation
Definition: Types.hpp:143
-
bool operator==(const armnn::DataLayout &dataLayout, const DataLayoutIndexed &indexed)
Equality methods.
-
Null Descriptor used as a return value from the IConnectableLayer GetParameters method by layers whic...
Definition: Descriptors.hpp:30
-
bool m_LayerNormEnabled
Enable/disable layer normalization.
-
uint32_t GetNumInputs(bool biasEnabled)
-
DataType
Definition: Types.hpp:48
-
float m_NmsIouThreshold
Intersection over union threshold.
-
float m_CellIntermediateScale
Cell intermediate quantization scale.
-
TransposeDescriptor(const PermutationVector &dimMappings)
-
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.
-
std::vector< unsigned int > m_Begin
Beginning indices of the slice in each 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.
- -
float m_Eps
Epsilon, small scalar value added to variance to avoid dividing by zero. Defaults to 1e-12f...
- -
A L2NormalizationDescriptor for the L2NormalizationLayer.
-
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:67
- -
An OriginsDescriptor for the ConcatLayer.
-
A ReduceDescriptor for the REDUCE operators.
-
float m_ProjectionClip
Clipping threshold value for the projection.
- -
A FullyConnectedDescriptor for the FullyConnectedLayer.
- - -
int32_t m_EllipsisMask
Ellipsis mask value.
-
bool m_BiasEnabled
Enable/disable bias.
- -
float m_InputIntermediateScale
Input intermediate quantization scale.
-
OutputShapeRounding m_OutputShapeRounding
The rounding method for the output shape. (Floor, Ceiling).
-
A FakeQuantizationDescriptor for the FakeQuantizationLayer.
- - -
uint32_t m_TargetWidth
Target width value.
-
A GatherDescriptor for the GatherLayer.
-
uint32_t m_PadBottom
Padding bottom value in the height dimension.
-
bool m_PeepholeEnabled
Enable/disable peephole.
-
Status
enumeration
Definition: Types.hpp:42
-
uint32_t m_NumClasses
Number of classes.
-
bool m_HalfPixelCenters
Half Pixel Centers.
-
float m_InputIntermediateScale
Input intermediate quantization scale.
-
uint32_t m_PadTop
Padding top value in the height dimension.
-
A StandInDescriptor for the StandIn layer.
-
A QLstmDescriptor for the QLstmLayer.
- - -
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.
-
PaddingMode
The padding mode controls whether the padding should be filled with constant values (Constant)...
Definition: Types.hpp:186
-
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:36
-
SpaceToBatchNdDescriptor(const std::vector< unsigned int > &blockShape, const std::vector< std::pair< unsigned int, unsigned int >> &padList)
- -
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.
-
A SliceDescriptor for the SliceLayer.
- -
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.
-
A BatchMatMulDescriptor for the BatchMatMul operator.
-
PaddingMode m_PaddingMode
Specifies the Padding mode (Constant, Reflect or Symmetric)
-
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
- -
float m_ForgetIntermediateScale
Forget intermediate quantization scale.
-
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
-
float m_Beta
Beta, the offset scalar value applied for the normalized tensor. Defaults to 1.0. ...
-
float m_HiddenStateScale
Hidden State quantization scale.
- -
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.
-
OutputShapeRounding
Definition: Types.hpp:207
-
DataLayout m_DataLayout
The data layout to be used (NDHWC, NCDHW).
-
NormalizationAlgorithmChannel m_NormChannelType
Normalization channel algorithm to use (Across, Within).
-
float m_CellClip
Clipping threshold value for the cell state.
-
#define ARMNN_DEPRECATED_MSG_REMOVAL_DATE(message, removed_in_release)
Definition: Deprecated.hpp:44
-
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.
-
FillDescriptor(const float &value)
-
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
- -
bool m_CifgEnabled
Enable/disable cifg (coupled input & forget gate).
-
StandInDescriptor(uint32_t numInputs, uint32_t numOutputs)
-
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.
-
int32_t m_Axis
The axis in params to gather indices from.
-
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.
- -
SpaceToDepthDescriptor(unsigned int blockSize, DataLayout dataLayout)
-
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.
-
bool m_ProjectionEnabled
Enable/disable the projection layer.
-
ArgMinMaxFunction
Definition: Types.hpp:102
-
OutputShapeRounding m_OutputShapeRounding
The rounding method for the output shape. (Floor, Ceiling).
-
uint32_t m_NumInputs
Number of input tensors.
- -
void SetConcatAxis(unsigned int concatAxis)
Set the concatenation axis value.
-
ResizeMethod
Definition: Types.hpp:152
-
A MeanDescriptor for the MeanLayer.
-
UnaryOperation
Definition: Types.hpp:124
- -
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.
-
uint32_t m_Axis
Axis to apply channel shuffle operation on.
- -
int m_Axis
Axis to reduce across the input tensor.
Definition: Descriptors.hpp:83
- -
float m_ScaleY
Center size encoding scale y.
-
OriginsDescriptor CreateDescriptorForConcatenation(TensorShapeIt first, TensorShapeIt last, unsigned int concatenationDimension)
Convenience template to create an OriginsDescriptor to use when creating a ConcatLayer for performing...
-
float m_NmsScoreThreshold
NMS score threshold.
- -
A PreCompiledDescriptor for the PreCompiledLayer.
-
GatherDescriptor(int32_t axis)
- - -
Krichevsky 2012: Local Brightness Normalization.
-
A Pooling2dDescriptor for the Pooling2dLayer.
- -
A NormalizationDescriptor for the NormalizationLayer.
- -
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).
-
-
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
-
PaddingMethod m_PaddingMethod
The padding method to be used. (Exclude, IgnoreValue).
-
NormalizationAlgorithmMethod
Definition: Types.hpp:199
- - -
A ChannelShuffleDescriptor for the ChannelShuffle operator.
- -
StackDescriptor(uint32_t axis, uint32_t numInputs, const TensorShape &inputShape)
-
ReshapeDescriptor(const TensorShape &shape)
-
float m_CellIntermediateScale
Cell intermediate quantization scale.
- -
LogicalBinaryDescriptor(LogicalBinaryOperation operation)
-
DetectionPostProcessDescriptor()
-
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.
- -
virtual bool IsNull() const
Definition: Descriptors.hpp:24
-
uint32_t m_StrideZ
Stride value when proceeding through input for the depth dimension.
- -
BatchToSpaceNdDescriptor(std::vector< unsigned int > blockShape, std::vector< std::pair< unsigned int, unsigned int >> crops)
-
bool m_CifgEnabled
Enable/disable CIFG (coupled input & forget gate).
-
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
-
armnn::DataType m_Output_Type
Deprecated and will be removed in future release.
Definition: Descriptors.hpp:85
- -
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 FillDescriptor for the FillLayer.
-
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
-
uint32_t m_PadLeft
Padding left value in the width dimension.
- -
ActivationFunction
Definition: Types.hpp:86
-
Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value)
Set the view origin coordinates.
- - -
A PermuteDescriptor for the PermuteLayer.
-
uint32_t m_PadRight
Padding right value in the width dimension.
-
int32_t m_HiddenStateZeroPoint
Hidden State zero point.
-
float m_OutputIntermediateScale
Output intermediate quantization scale.
-
bool m_ConstantWeights
Enable/disable constant weights and biases.
- +Go to the documentation of this file.
1 //
+
2 // Copyright © 2017,2022 Arm Ltd and Contributors. All rights reserved.
+
3 // SPDX-License-Identifier: MIT
+
4 //
+
5 #pragma once
+
6 
+
7 #include "Deprecated.hpp"
+
8 #include "DescriptorsFwd.hpp" // Required for class equivalence declarations.
+
9 #include "Tensor.hpp"
+
10 #include "Types.hpp"
+
11 #include <armnn/Exceptions.hpp>
+
12 
+
13 #include <cstdint>
+
14 #include <iterator>
+
15 #include <utility>
+
16 #include <vector>
+
17 
+
18 namespace armnn
+
19 {
+
20 
+
21 /// Base class for all descriptors.
+ +
23 {
+
24  virtual bool IsNull() const { return false; }
+
25  virtual ~BaseDescriptor() = default;
+
26 };
+
27 
+
28 /// Null Descriptor used as a return value from the IConnectableLayer GetParameters method
+
29 /// by layers which do not have a descriptor
+ +
31 {
+
32  bool IsNull() const override { return true; }
+
33 };
+
34 
+
35 /// An ActivationDescriptor for the ActivationLayer.
+ +
37 {
+ + +
40  , m_A(0)
+
41  , m_B(0)
+
42  {}
+
43 
+ +
45  float a = 0,
+
46  float b = 0)
+
47  : m_Function(activation)
+
48  , m_A(a)
+
49  , m_B(b)
+
50  {}
+
51 
+
52  bool operator ==(const ActivationDescriptor &rhs) const
+
53  {
+
54  return m_Function == rhs.m_Function && m_A == rhs.m_B && m_B == rhs.m_B;
+
55  }
+
56 
+
57  /// @brief The activation function to use
+
58  /// (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).
+ +
60  /// Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH, Elu).
+
61  float m_A;
+
62  /// Beta lower bound value used by the activation functions. (BoundedReLu, Linear, TanH).
+
63  float m_B;
+
64 };
+
65 
+
66 /// An ArgMinMaxDescriptor for ArgMinMaxLayer
+ +
68 {
+ + +
71  , m_Axis(-1)
+ +
73  {}
+
74 
+
75  bool operator ==(const ArgMinMaxDescriptor &rhs) const
+
76  {
+
77  return m_Function == rhs.m_Function && m_Axis == rhs.m_Axis && m_Output_Type == rhs.m_Output_Type;
+
78  }
+
79 
+
80  /// Specify if the function is to find Min or Max.
+ +
82  /// Axis to reduce across the input tensor.
+
83  int m_Axis;
+
84  /// Deprecated and will be removed in future release.
+ +
86 };
+
87 
+
88 /// A ComparisonDescriptor for the ComparisonLayer
+ +
90 {
+ + +
93  {}
+
94 
+ +
96  : m_Operation(operation)
+
97  {}
+
98 
+
99  bool operator ==(const ComparisonDescriptor &rhs) const
+
100  {
+
101  return m_Operation == rhs.m_Operation;
+
102  }
+
103 
+
104  /// Specifies the comparison operation to execute
+ +
106 };
+
107 
+
108 /// A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer
+ +
110 {
+ + +
113  {}
+
114 
+ +
116  : m_Operation(operation)
+
117  {}
+
118 
+ +
120  {
+
121  return m_Operation == rhs.m_Operation;
+
122  }
+
123 
+
124  /// Specifies the elementwiseUnary operation to execute
+ +
126 };
+
127 
+
128 /// A PermuteDescriptor for the PermuteLayer.
+ +
130 {
+ +
132  : m_DimMappings{}
+
133  {}
+
134 
+ +
136  : m_DimMappings(dimMappings)
+
137  {}
+
138 
+
139  bool operator ==(const PermuteDescriptor &rhs) const
+
140  {
+
141  return m_DimMappings.IsEqual(rhs.m_DimMappings);
+
142  }
+
143 
+
144  /// @brief Indicates how to translate tensor elements from a given source into the target destination, when
+
145  /// source and target potentially have different memory layouts e.g.
+
146  /// Input Shape {1, 1, 4, 4}
+
147  /// Permutation Vector {0, 2, 3, 1}
+
148  /// Output Shape {1, 4, 1, 4}
+
149  /// dim "0" goes into index 0 ([ 1, X, X, X ])
+
150  /// dim "1" goes into index 2 ([ 1, X, 1, X ])
+
151  /// dim "2" goes into index 3 ([ 1, X, 1, 4 ])
+
152  /// dim "3" goes into index 1 ([ 1, 4, 1, 4 ])
+ +
154 };
+
155 
+
156 /// A SoftmaxDescriptor for the SoftmaxLayer.
+ +
158 {
+ +
160  : m_Beta(1.0f)
+
161  , m_Axis(-1)
+
162  {}
+
163 
+
164  bool operator ==(const SoftmaxDescriptor& rhs) const
+
165  {
+
166  return m_Beta == rhs.m_Beta && m_Axis == rhs.m_Axis;
+
167  }
+
168 
+
169  /// Exponentiation value.
+
170  float m_Beta;
+
171  /// Scalar, defaulted to the last index (-1), specifying the dimension the activation will be performed on.
+
172  int m_Axis;
+
173 };
+
174 
+
175 /// A LogSoftmaxDescriptor for the LogSoftmaxLayer
+ +
177 
+
178 /// @brief An OriginsDescriptor for the ConcatLayer.
+
179 /// Descriptor to configure the concatenation process. Number of views must be equal to the number of inputs, and
+
180 /// their order must match - e.g. first view corresponds to the first input, second view to the second input, etc.
+ +
182 {
+ +
184  OriginsDescriptor(uint32_t numViews, uint32_t numDimensions = 4);
+
185  OriginsDescriptor(const OriginsDescriptor& other);
+ +
187 
+ +
189 
+ +
191 
+
192  bool operator ==(const OriginsDescriptor& rhs) const;
+
193 
+
194  /// @Brief Set the view origin coordinates. The arguments are: view, dimension, value.
+
195  /// If the view is greater than or equal to GetNumViews(), then the view argument is out of range.
+
196  /// If the coord is greater than or equal to GetNumDimensions(), then the coord argument is out of range.
+
197  Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value);
+
198  /// Get the number of views.
+
199  uint32_t GetNumViews() const;
+
200  /// Get the number of dimensions.
+
201  uint32_t GetNumDimensions() const;
+
202  /// Return the view origin at the int value idx.
+
203  const uint32_t* GetViewOrigin(uint32_t idx) const;
+
204  /// @brief Reorders the viewOrigins in accordance with the indices presented in newOrdering array.
+
205  /// The number of views must match number of elements in the new ordering array.
+
206  void ReorderOrigins(unsigned int* newOrdering, unsigned int numNewOrdering);
+
207  /// Swap the ViewsDescriptor values first and second.
+
208  friend void swap(OriginsDescriptor& first, OriginsDescriptor& second);
+
209  /// Set the concatenation axis value.
+
210  void SetConcatAxis(unsigned int concatAxis);
+
211  /// Get the concatenation axis value.
+
212  unsigned int GetConcatAxis() const;
+
213 
+
214 private:
+
215  unsigned int m_ConcatAxis;
+
216  uint32_t m_NumViews;
+
217  uint32_t m_NumDimensions;
+
218  uint32_t** m_ViewOrigins;
+
219 };
+
220 
+
221 /// @brief A ViewsDescriptor for the SplitterLayer.
+
222 /// Descriptor to configure the splitting process. Number of Views must be equal to the number of outputs, and
+
223 /// their order must match - e.g. first view corresponds to the first output, second view to the second output, etc.
+ +
225 {
+
226  ViewsDescriptor(uint32_t numViews, uint32_t numDimensions = 4);
+
227  ViewsDescriptor(const ViewsDescriptor& other);
+
228  ViewsDescriptor();
+ +
230 
+ +
232 
+ +
234 
+
235  bool operator ==(const ViewsDescriptor& rhs) const;
+
236 
+
237  /// @Brief Set the view origin coordinates. The arguments are: view, dimension, value.
+
238  /// If the view is greater than or equal to GetNumViews(), then the view argument is out of range.
+
239  /// If the coord is greater than or equal to GetNumDimensions(), then the coord argument is out of range.
+
240  Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value);
+
241  /// @brief Set the size of the views. The arguments are: view, dimension, value.
+
242  /// If the view is greater than or equal to GetNumViews(), then the view argument is out of range.
+
243  /// If the coord is greater than or equal to GetNumDimensions(), then the coord argument is out of range.
+
244  Status SetViewSize(uint32_t view, uint32_t coord, uint32_t value);
+
245 
+
246  /// Get the number of views.
+
247  uint32_t GetNumViews() const;
+
248  /// Get the number of dimensions.
+
249  uint32_t GetNumDimensions() const;
+
250  /// Get the view origin at the int value idx.
+
251  const uint32_t* GetViewOrigin(uint32_t idx) const;
+
252  /// Get the view sizes at the int value idx.
+
253  const uint32_t* GetViewSizes(uint32_t idx) const;
+
254  /// Get the View Origins
+
255  const OriginsDescriptor& GetOrigins() const;
+
256 
+
257  /// Swap the ViewsDescriptor value first and second.
+
258  friend void swap(ViewsDescriptor& first, ViewsDescriptor& second);
+
259 private:
+
260  OriginsDescriptor m_Origins;
+
261  uint32_t** m_ViewSizes;
+
262 };
+
263 
+
264 
+
265 /// @brief Convenience template to create an OriginsDescriptor to use when creating a ConcatLayer for performing
+
266 /// concatenation of a number of input tensors.
+
267 template <typename TensorShapeIt>
+ +
269  TensorShapeIt last,
+
270  unsigned int concatenationDimension)
+
271 {
+
272  auto numInputs = std::distance(first, last);
+
273 
+
274  if (numInputs < 2)
+
275  {
+
276  throw InvalidArgumentException("Concatenation requires at least 2 inputs");
+
277  }
+
278 
+
279  const auto& firstInputShape = *first;
+
280 
+
281  const unsigned int numDimensions = firstInputShape.GetNumDimensions();
+
282  for (auto it = first + 1; it != last; ++it)
+
283  {
+
284  if (it->GetNumDimensions() != numDimensions)
+
285  {
+
286  throw InvalidArgumentException("All inputs to concatenation must have the same number of dimensions");
+
287  }
+
288  }
+
289 
+
290  if (concatenationDimension >= numDimensions)
+
291  {
+
292  throw InvalidArgumentException("concatenationDimension must be between 0 and the number of dimensions.");
+
293  }
+
294 
+
295  for (auto it = first; it != last; ++it)
+
296  {
+
297  for (unsigned int d = 0; d < numDimensions; ++d)
+
298  {
+
299  const bool dimSizeOk = (d == concatenationDimension) || (firstInputShape[d] == (*it)[d]);
+
300  if (!dimSizeOk)
+
301  {
+
302  throw InvalidArgumentException("All inputs to concatenation must be the same size along all dimensions "
+
303  " except the concatenation dimension");
+
304  }
+
305  }
+
306  }
+
307 
+
308  OriginsDescriptor viewsDescriptor(static_cast<uint32_t>(numInputs), numDimensions);
+
309  viewsDescriptor.SetConcatAxis(concatenationDimension);
+
310 
+
311  uint32_t viewIndex = 0u;
+
312  uint32_t coordAlongConcatDim = 0u;
+
313  for (auto it = first; it != last; ++it)
+
314  {
+
315  const auto& inputShape = *it;
+
316 
+
317  for (unsigned int i = 0; i < concatenationDimension; ++i)
+
318  {
+
319  viewsDescriptor.SetViewOriginCoord(viewIndex, i, 0);
+
320  }
+
321 
+
322  viewsDescriptor.SetViewOriginCoord(viewIndex, concatenationDimension, coordAlongConcatDim);
+
323  unsigned int dimSize = inputShape[concatenationDimension];
+
324  coordAlongConcatDim += dimSize;
+
325 
+
326 
+
327  for (unsigned int i = concatenationDimension + 1; i < numDimensions; ++i)
+
328  {
+
329  viewsDescriptor.SetViewOriginCoord(viewIndex, i, 0);
+
330  }
+
331 
+
332  ++viewIndex;
+
333  }
+
334 
+
335  return viewsDescriptor;
+
336 }
+
337 
+
338 /// A Pooling2dDescriptor for the Pooling2dLayer.
+ +
340 {
+ + +
343  , m_PadLeft(0)
+
344  , m_PadRight(0)
+
345  , m_PadTop(0)
+
346  , m_PadBottom(0)
+
347  , m_PoolWidth(0)
+
348  , m_PoolHeight(0)
+
349  , m_StrideX(0)
+
350  , m_StrideY(0)
+ + + +
354  {}
+
355 
+
356  bool operator ==(const Pooling2dDescriptor& rhs) const
+
357  {
+
358  return m_PoolType == rhs.m_PoolType &&
+
359  m_PadLeft == rhs.m_PadLeft &&
+
360  m_PadRight == rhs.m_PadRight &&
+
361  m_PadTop == rhs.m_PadTop &&
+
362  m_PadBottom == rhs.m_PadBottom &&
+
363  m_PoolWidth == rhs.m_PoolWidth &&
+
364  m_PoolHeight == rhs.m_PoolHeight &&
+
365  m_StrideX == rhs.m_StrideX &&
+
366  m_StrideY == rhs.m_StrideY &&
+ + +
369  m_DataLayout == rhs.m_DataLayout;
+
370  }
+
371 
+
372  /// The pooling algorithm to use (Max. Average, L2).
+ +
374  /// Padding left value in the width dimension.
+
375  uint32_t m_PadLeft;
+
376  /// Padding right value in the width dimension.
+
377  uint32_t m_PadRight;
+
378  /// Padding top value in the height dimension.
+
379  uint32_t m_PadTop;
+
380  /// Padding bottom value in the height dimension.
+
381  uint32_t m_PadBottom;
+
382  /// Pooling width value.
+
383  uint32_t m_PoolWidth;
+
384  /// Pooling height value.
+
385  uint32_t m_PoolHeight;
+
386  /// Stride value when proceeding through input for the width dimension.
+
387  uint32_t m_StrideX;
+
388  /// Stride value when proceeding through input for the height dimension.
+
389  uint32_t m_StrideY;
+
390  /// The rounding method for the output shape. (Floor, Ceiling).
+ +
392  /// The padding method to be used. (Exclude, IgnoreValue).
+ +
394  /// The data layout to be used (NCHW, NHWC).
+ +
396 };
+
397 
+
398 /// A Pooling3dDescriptor for the Pooling3dLayer.
+ +
400 {
+ + +
403  , m_PadLeft(0)
+
404  , m_PadRight(0)
+
405  , m_PadTop(0)
+
406  , m_PadBottom(0)
+
407  , m_PadFront(0)
+
408  , m_PadBack(0)
+
409  , m_PoolWidth(0)
+
410  , m_PoolHeight(0)
+
411  , m_PoolDepth(0)
+
412  , m_StrideX(0)
+
413  , m_StrideY(0)
+
414  , m_StrideZ(0)
+ + + +
418  {}
+
419 
+
420  bool operator ==(const Pooling3dDescriptor& rhs) const
+
421  {
+
422  return m_PoolType == rhs.m_PoolType &&
+
423  m_PadLeft == rhs.m_PadLeft &&
+
424  m_PadRight == rhs.m_PadRight &&
+
425  m_PadTop == rhs.m_PadTop &&
+
426  m_PadBottom == rhs.m_PadBottom &&
+
427  m_PadFront == rhs.m_PadFront &&
+
428  m_PadBack == rhs.m_PadBack &&
+
429  m_PoolWidth == rhs.m_PoolWidth &&
+
430  m_PoolHeight == rhs.m_PoolHeight &&
+
431  m_PoolDepth == rhs.m_PoolDepth &&
+
432  m_StrideX == rhs.m_StrideX &&
+
433  m_StrideY == rhs.m_StrideY &&
+
434  m_StrideZ == rhs.m_StrideZ &&
+ + +
437  m_DataLayout == rhs.m_DataLayout;
+
438  }
+
439 
+
440  /// The pooling algorithm to use (Max. Average, L2).
+ +
442  /// Padding left value in the width dimension.
+
443  uint32_t m_PadLeft;
+
444  /// Padding right value in the width dimension.
+
445  uint32_t m_PadRight;
+
446  /// Padding top value in the height dimension.
+
447  uint32_t m_PadTop;
+
448  /// Padding bottom value in the height dimension.
+
449  uint32_t m_PadBottom;
+
450  /// Padding front value in the depth dimension.
+
451  uint32_t m_PadFront;
+
452  /// Padding back value in the depth dimension.
+
453  uint32_t m_PadBack;
+
454  /// Pooling width value.
+
455  uint32_t m_PoolWidth;
+
456  /// Pooling height value.
+
457  uint32_t m_PoolHeight;
+
458  /// Pooling depth value.
+
459  uint32_t m_PoolDepth;
+
460  /// Stride value when proceeding through input for the width dimension.
+
461  uint32_t m_StrideX;
+
462  /// Stride value when proceeding through input for the height dimension.
+
463  uint32_t m_StrideY;
+
464  /// Stride value when proceeding through input for the depth dimension.
+
465  uint32_t m_StrideZ;
+
466  /// The rounding method for the output shape. (Floor, Ceiling).
+ +
468  /// The padding method to be used. (Exclude, IgnoreValue).
+ +
470  /// The data layout to be used (NCDHW, NDHWC).
+ +
472 };
+
473 
+
474 /// A FullyConnectedDescriptor for the FullyConnectedLayer.
+ +
476 {
+ +
478  : m_BiasEnabled(false)
+
479  , m_TransposeWeightMatrix(false)
+
480  , m_ConstantWeights(true)
+
481  {}
+
482 
+
483  bool operator ==(const FullyConnectedDescriptor& rhs) const
+
484  {
+
485  return m_BiasEnabled == rhs.m_BiasEnabled
+ + +
488  }
+
489 
+
490  /// Get the number of inputs.
+
491  uint32_t GetNumInputs() const;
+
492 
+
493  /// Enable/disable bias.
+ +
495  /// Enable/disable transpose weight matrix.
+ +
497  /// Enable/disable constant weights and biases.
+ +
499 };
+
500 
+
501 /// A Convolution2dDescriptor for the Convolution2dLayer.
+ +
503 {
+ +
505  : m_PadLeft(0)
+
506  , m_PadRight(0)
+
507  , m_PadTop(0)
+
508  , m_PadBottom(0)
+
509  , m_StrideX(1)
+
510  , m_StrideY(1)
+
511  , m_DilationX(1)
+
512  , m_DilationY(1)
+
513  , m_BiasEnabled(false)
+ +
515  {}
+
516 
+
517  bool operator ==(const Convolution2dDescriptor& rhs) const
+
518  {
+
519  return m_PadLeft == rhs.m_PadLeft &&
+
520  m_PadRight == rhs.m_PadRight &&
+
521  m_PadTop == rhs.m_PadTop &&
+
522  m_PadBottom == rhs.m_PadBottom &&
+
523  m_StrideX == rhs.m_StrideX &&
+
524  m_StrideY == rhs.m_StrideY &&
+
525  m_DilationX == rhs.m_DilationX &&
+
526  m_DilationY == rhs.m_DilationY &&
+
527  m_BiasEnabled == rhs.m_BiasEnabled &&
+
528  m_DataLayout == rhs.m_DataLayout;
+
529  }
+
530  uint32_t GetNumInputs() const;
+
531 
+
532 
+
533  /// Padding left value in the width dimension.
+
534  uint32_t m_PadLeft;
+
535  /// Padding right value in the width dimension.
+
536  uint32_t m_PadRight;
+
537  /// Padding top value in the height dimension.
+
538  uint32_t m_PadTop;
+
539  /// Padding bottom value in the height dimension.
+
540  uint32_t m_PadBottom;
+
541  /// Stride value when proceeding through input for the width dimension.
+
542  uint32_t m_StrideX;
+
543  /// Stride value when proceeding through input for the height dimension.
+
544  uint32_t m_StrideY;
+
545  /// Dilation along x axis
+
546  uint32_t m_DilationX;
+
547  /// Dilation along y axis
+
548  uint32_t m_DilationY;
+
549  /// Enable/disable bias.
+ +
551  /// The data layout to be used (NCHW, NHWC).
+ +
553 };
+
554 
+
555 /// A Convolution3dDescriptor for the Convolution3dLayer.
+ +
557 {
+ +
559  : m_PadLeft(0)
+
560  , m_PadRight(0)
+
561  , m_PadTop(0)
+
562  , m_PadBottom(0)
+
563  , m_PadFront(0)
+
564  , m_PadBack(0)
+
565  , m_StrideX(1)
+
566  , m_StrideY(1)
+
567  , m_StrideZ(1)
+
568  , m_DilationX(1)
+
569  , m_DilationY(1)
+
570  , m_DilationZ(1)
+
571  , m_BiasEnabled(false)
+ +
573  {}
+
574 
+
575  bool operator ==(const Convolution3dDescriptor& rhs) const
+
576  {
+
577  return m_PadLeft == rhs.m_PadLeft &&
+
578  m_PadRight == rhs.m_PadRight &&
+
579  m_PadTop == rhs.m_PadTop &&
+
580  m_PadBottom == rhs.m_PadBottom &&
+
581  m_PadFront == rhs.m_PadFront &&
+
582  m_PadBack == rhs.m_PadBack &&
+
583  m_StrideX == rhs.m_StrideX &&
+
584  m_StrideY == rhs.m_StrideY &&
+
585  m_StrideZ == rhs.m_StrideZ &&
+
586  m_DilationX == rhs.m_DilationX &&
+
587  m_DilationY == rhs.m_DilationY &&
+
588  m_DilationZ == rhs.m_DilationZ &&
+
589  m_BiasEnabled == rhs.m_BiasEnabled &&
+
590  m_DataLayout == rhs.m_DataLayout;
+
591  }
+
592 
+
593  /// Get the number of views/inputs.
+
594  uint32_t GetNumInputs() const;
+
595 
+
596  /// Padding left value in the width dimension.
+
597  uint32_t m_PadLeft;
+
598  /// Padding right value in the width dimension.
+
599  uint32_t m_PadRight;
+
600  /// Padding top value in the height dimension.
+
601  uint32_t m_PadTop;
+
602  /// Padding bottom value in the height dimension.
+
603  uint32_t m_PadBottom;
+
604  /// Padding front value in the depth dimension.
+
605  uint32_t m_PadFront;
+
606  /// Padding back value in the depth dimension.
+
607  uint32_t m_PadBack;
+
608  /// Stride value when proceeding through input for the width dimension.
+
609  uint32_t m_StrideX;
+
610  /// Stride value when proceeding through input for the height dimension.
+
611  uint32_t m_StrideY;
+
612  /// Stride value when proceeding through input for the depth dimension.
+
613  uint32_t m_StrideZ;
+
614  /// Dilation along x axis
+
615  uint32_t m_DilationX;
+
616  /// Dilation along y axis
+
617  uint32_t m_DilationY;
+
618  /// Dilation along z axis
+
619  uint32_t m_DilationZ;
+
620  /// Enable/disable bias.
+ +
622  /// The data layout to be used (NDHWC, NCDHW).
+ +
624 };
+
625 
+
626 /// A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
+ +
628 {
+ +
630  : m_PadLeft(0)
+
631  , m_PadRight(0)
+
632  , m_PadTop(0)
+
633  , m_PadBottom(0)
+
634  , m_StrideX(1)
+
635  , m_StrideY(1)
+
636  , m_DilationX(1)
+
637  , m_DilationY(1)
+
638  , m_BiasEnabled(false)
+ +
640  {}
+
641 
+ +
643  {
+
644  return m_PadLeft == rhs.m_PadLeft &&
+
645  m_PadRight == rhs.m_PadRight &&
+
646  m_PadTop == rhs.m_PadTop &&
+
647  m_PadBottom == rhs.m_PadBottom &&
+
648  m_StrideX == rhs.m_StrideX &&
+
649  m_StrideY == rhs.m_StrideY &&
+
650  m_DilationX == rhs.m_DilationX &&
+
651  m_DilationY == rhs.m_DilationY &&
+
652  m_BiasEnabled == rhs.m_BiasEnabled &&
+
653  m_DataLayout == rhs.m_DataLayout;
+
654  }
+
655 
+
656  /// Get the number of views/inputs.
+
657  uint32_t GetNumInputs() const;
+
658 
+
659  /// Padding left value in the width dimension.
+
660  uint32_t m_PadLeft;
+
661  /// Padding right value in the width dimension.
+
662  uint32_t m_PadRight;
+
663  /// Padding top value in the height dimension.
+
664  uint32_t m_PadTop;
+
665  /// Padding bottom value in the height dimension.
+
666  uint32_t m_PadBottom;
+
667  /// Stride value when proceeding through input for the width dimension.
+
668  uint32_t m_StrideX;
+
669  /// Stride value when proceeding through input for the height dimension.
+
670  uint32_t m_StrideY;
+
671  /// Dilation factor value for width dimension.
+
672  uint32_t m_DilationX;
+
673  /// Dilation factor value for height dimension.
+
674  uint32_t m_DilationY;
+
675  /// Enable/disable bias.
+ +
677  /// The data layout to be used (NCHW, NHWC).
+ +
679 };
+
680 
+ +
682 {
+ +
684  : m_MaxDetections(0)
+ + + +
688  , m_NmsIouThreshold(0)
+
689  , m_NumClasses(0)
+
690  , m_UseRegularNms(false)
+
691  , m_ScaleX(0)
+
692  , m_ScaleY(0)
+
693  , m_ScaleW(0)
+
694  , m_ScaleH(0)
+
695  {}
+
696 
+ +
698  {
+
699  return m_MaxDetections == rhs.m_MaxDetections &&
+ + + + +
704  m_NumClasses == rhs.m_NumClasses &&
+ +
706  m_ScaleX == rhs.m_ScaleX &&
+
707  m_ScaleY == rhs.m_ScaleY &&
+
708  m_ScaleW == rhs.m_ScaleW &&
+
709  m_ScaleH == rhs.m_ScaleH;
+
710  }
+
711 
+
712  /// Maximum numbers of detections.
+
713  uint32_t m_MaxDetections;
+
714  /// Maximum numbers of classes per detection, used in Fast NMS.
+ +
716  /// Detections per classes, used in Regular NMS.
+ +
718  /// NMS score threshold.
+ +
720  /// Intersection over union threshold.
+ +
722  /// Number of classes.
+
723  uint32_t m_NumClasses;
+
724  /// Use Regular NMS.
+ +
726  /// Center size encoding scale x.
+
727  float m_ScaleX;
+
728  /// Center size encoding scale y.
+
729  float m_ScaleY;
+
730  /// Center size encoding scale weight.
+
731  float m_ScaleW;
+
732  /// Center size encoding scale height.
+
733  float m_ScaleH;
+
734 };
+
735 
+
736 /// A NormalizationDescriptor for the NormalizationLayer.
+ +
738 {
+ + + +
742  , m_NormSize(0)
+
743  , m_Alpha(0.f)
+
744  , m_Beta(0.f)
+
745  , m_K(0.f)
+ +
747  {}
+
748 
+
749  bool operator ==(const NormalizationDescriptor& rhs) const
+
750  {
+
751  return m_NormChannelType == rhs.m_NormChannelType &&
+ +
753  m_NormSize == rhs.m_NormSize &&
+
754  m_Alpha == rhs.m_Alpha &&
+
755  m_Beta == rhs.m_Beta &&
+
756  m_K == rhs.m_K &&
+
757  m_DataLayout == rhs.m_DataLayout;
+
758  }
+
759 
+
760  /// Normalization channel algorithm to use (Across, Within).
+ +
762  /// Normalization method algorithm to use (LocalBrightness, LocalContrast).
+ +
764  /// Depth radius value.
+
765  uint32_t m_NormSize;
+
766  /// Alpha value for the normalization equation.
+
767  float m_Alpha;
+
768  /// Beta value for the normalization equation.
+
769  float m_Beta;
+
770  /// Kappa value used for the across channel normalization equation.
+
771  float m_K;
+
772  /// The data layout to be used (NCHW, NHWC).
+ +
774 };
+
775 
+
776 /// A L2NormalizationDescriptor for the L2NormalizationLayer.
+ +
778 {
+ +
780  : m_Eps(1e-12f)
+ +
782  {}
+
783 
+
784  bool operator ==(const L2NormalizationDescriptor& rhs) const
+
785  {
+
786  return m_Eps == rhs.m_Eps && m_DataLayout == rhs.m_DataLayout;
+
787  }
+
788 
+
789  /// Used to avoid dividing by zero.
+
790  float m_Eps;
+
791  /// The data layout to be used (NCHW, NHWC).
+ +
793 };
+
794 
+
795 /// A BatchNormalizationDescriptor for the BatchNormalizationLayer.
+ +
797 {
+ +
799  : m_Eps(0.0001f)
+ +
801  {}
+
802 
+ +
804  {
+
805  return m_Eps == rhs.m_Eps && m_DataLayout == rhs.m_DataLayout;
+
806  }
+
807 
+
808  /// Value to add to the variance. Used to avoid dividing by zero.
+
809  float m_Eps;
+
810  /// The data layout to be used (NCHW, NHWC).
+ +
812 };
+
813 
+
814 /// An InstanceNormalizationDescriptor for InstanceNormalizationLayer
+ +
816 {
+ +
818  : m_Gamma(1.0f)
+
819  , m_Beta(0.0f)
+
820  , m_Eps(1e-12f)
+ +
822  {}
+
823 
+ +
825  {
+
826  return m_Gamma == rhs.m_Gamma &&
+
827  m_Beta == rhs.m_Beta &&
+
828  m_Eps == rhs.m_Eps &&
+
829  m_DataLayout == rhs.m_DataLayout;
+
830  }
+
831 
+
832  /// Gamma, the scale scalar value applied for the normalized tensor. Defaults to 1.0.
+
833  float m_Gamma;
+
834  /// Beta, the offset scalar value applied for the normalized tensor. Defaults to 1.0.
+
835  float m_Beta;
+
836  /// Epsilon, small scalar value added to variance to avoid dividing by zero. Defaults to 1e-12f.
+
837  float m_Eps;
+
838  /// The data layout to be used (NCHW, NHWC).
+ +
840 };
+
841 
+
842 /// A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
+ +
844 {
+ +
846  : m_BlockShape({1, 1})
+
847  , m_Crops({{0, 0}, {0, 0}})
+ +
849  {}
+
850 
+
851  BatchToSpaceNdDescriptor(std::vector<unsigned int> blockShape,
+
852  std::vector<std::pair<unsigned int, unsigned int>> crops)
+
853  : m_BlockShape(blockShape)
+
854  , m_Crops(crops)
+ +
856  {}
+
857 
+
858  bool operator ==(const BatchToSpaceNdDescriptor& rhs) const
+
859  {
+
860  return m_BlockShape == rhs.m_BlockShape &&
+
861  m_Crops == rhs.m_Crops &&
+
862  m_DataLayout == rhs.m_DataLayout;
+
863  }
+
864 
+
865  /// Block shape values.
+
866  std::vector<unsigned int> m_BlockShape;
+
867  /// The values to crop from the input dimension.
+
868  std::vector<std::pair<unsigned int, unsigned int>> m_Crops;
+
869  /// The data layout to be used (NCHW, NHWC).
+ +
871 };
+
872 
+
873 /// A FakeQuantizationDescriptor for the FakeQuantizationLayer.
+ +
875 {
+ +
877  : m_Min(-6.0f)
+
878  , m_Max(6.0f)
+
879  {}
+
880 
+ +
882  {
+
883  return m_Min == rhs.m_Min && m_Max == rhs.m_Max;
+
884  }
+
885 
+
886  /// Minimum value.
+
887  float m_Min;
+
888  /// Maximum value.
+
889  float m_Max;
+
890 };
+
891 
+
892 /// A FillDescriptor for the FillLayer
+ +
894 {
+ +
896  : m_Value(0)
+
897  {}
+
898 
+
899  FillDescriptor(const float& value)
+
900  : m_Value(value)
+
901  {}
+
902 
+
903  bool operator ==(const FillDescriptor& rhs) const
+
904  {
+
905  return m_Value == rhs.m_Value;
+
906  }
+
907 
+
908  float m_Value;
+
909 };
+
910 
+
911 /// A GatherDescriptor for the GatherLayer.
+ +
913 {
+ +
915  : m_Axis(0)
+
916  {}
+
917 
+
918  GatherDescriptor(int32_t axis)
+
919  : m_Axis(axis)
+
920  {}
+
921 
+
922  bool operator ==(const GatherDescriptor& rhs) const
+
923  {
+
924  return m_Axis == rhs.m_Axis;
+
925  }
+
926 
+
927  /// The axis in params to gather indices from
+
928  int32_t m_Axis;
+
929 };
+
930 
+
931 /// A ResizeDescriptor for the ResizeLayer.
+ +
933 {
+ +
935  : m_TargetWidth(0)
+
936  , m_TargetHeight(0)
+ + +
939  , m_AlignCorners(false)
+
940  , m_HalfPixelCenters(false)
+
941  {}
+
942 
+
943  bool operator ==(const ResizeDescriptor& rhs) const
+
944  {
+
945  return m_TargetWidth == rhs.m_TargetWidth &&
+ +
947  m_Method == rhs.m_Method &&
+
948  m_DataLayout == rhs.m_DataLayout &&
+ + +
951  }
+
952 
+
953  /// Target width value.
+
954  uint32_t m_TargetWidth;
+
955  /// Target height value.
+
956  uint32_t m_TargetHeight;
+
957  /// The Interpolation method to use
+
958  /// (Bilinear, NearestNeighbor).
+ +
960  /// The data layout to be used (NCHW, NHWC).
+ +
962  /// Aligned corners
+ +
964  /// Half Pixel Centers
+ +
966 };
+
967 
+
968 
+
969 /// A ReshapeDescriptor for the ReshapeLayer.
+ +
971 {
+ +
973  : m_TargetShape()
+
974  {}
+
975 
+ +
977  : m_TargetShape(shape)
+
978  {}
+
979 
+
980  bool operator ==(const ReshapeDescriptor& rhs) const
+
981  {
+
982  return m_TargetShape == rhs.m_TargetShape;
+
983  }
+
984 
+
985  /// Target shape value.
+ +
987 };
+
988 
+
989 /// A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
+ +
991 {
+ +
993  : m_BlockShape({1, 1})
+
994  , m_PadList({{0, 0}, {0, 0}})
+ +
996  {}
+
997 
+
998  SpaceToBatchNdDescriptor(const std::vector<unsigned int>& blockShape,
+
999  const std::vector<std::pair<unsigned int, unsigned int>>& padList)
+
1000  : m_BlockShape(blockShape)
+
1001  , m_PadList(padList)
+ +
1003  {}
+
1004 
+
1005  bool operator ==(const SpaceToBatchNdDescriptor& rhs) const
+
1006  {
+
1007  return m_BlockShape == rhs.m_BlockShape &&
+
1008  m_PadList == rhs.m_PadList &&
+
1009  m_DataLayout == rhs.m_DataLayout;
+
1010  }
+
1011 
+
1012  /// Block shape value.
+
1013  std::vector<unsigned int> m_BlockShape;
+
1014  /// @brief Specifies the padding values for the input dimension:
+
1015  /// heightPad{top, bottom} widthPad{left, right}.
+
1016  std::vector<std::pair<unsigned int, unsigned int>> m_PadList;
+
1017  /// The data layout to be used (NCHW, NHWC).
+ +
1019 };
+
1020 
+
1021 /// A SpaceToDepthDescriptor for the SpaceToDepthLayer
+ +
1023 {
+ + +
1026  {}
+
1027 
+
1028  SpaceToDepthDescriptor(unsigned int blockSize, DataLayout dataLayout)
+
1029  : m_BlockSize(blockSize)
+
1030  , m_DataLayout(dataLayout)
+
1031  {}
+
1032 
+
1033  bool operator ==(const SpaceToDepthDescriptor& rhs) const
+
1034  {
+
1035  return m_BlockSize == rhs.m_BlockSize && m_DataLayout == rhs.m_DataLayout;
+
1036  }
+
1037 
+
1038  /// Scalar specifying the input block size. It must be >= 1
+
1039  unsigned int m_BlockSize;
+
1040 
+
1041  /// The data layout to be used (NCHW, NHWC).
+ +
1043 };
+
1044 
+
1045 /// A DepthToSpaceDescriptor for the DepthToSpaceLayer
+ +
1047 
+
1048 /// An LstmDescriptor for the LstmLayer.
+ +
1050 {
+ +
1052  : m_ActivationFunc(1) // 0: None, 1: Relu, 3: Relu6, 4: Tanh, 6: Sigmoid
+
1053  , m_ClippingThresCell(0.0)
+
1054  , m_ClippingThresProj(0.0)
+
1055  , m_CifgEnabled(true)
+
1056  , m_PeepholeEnabled(false)
+
1057  , m_ProjectionEnabled(false)
+
1058  , m_LayerNormEnabled(false)
+
1059  , m_TimeMajor(false)
+ + + + + +
1065  , m_HiddenStateScale(0.0)
+
1066  {}
+
1067 
+
1068  bool operator ==(const LstmDescriptor& rhs) const
+
1069  {
+
1070  return m_ActivationFunc == rhs.m_ActivationFunc &&
+ + +
1073  m_CifgEnabled == rhs.m_CifgEnabled &&
+ + +
1076  m_TimeMajor == rhs.m_TimeMajor &&
+ + + + + + +
1083  }
+
1084 
+
1085  /// @brief The activation function to use.
+
1086  /// 0: None, 1: Relu, 3: Relu6, 4: Tanh, 6: Sigmoid.
+ +
1088  /// Clipping threshold value for the cell state.
+ +
1090  /// Clipping threshold value for the projection.
+ +
1092  /// Enable/disable cifg (coupled input & forget gate).
+ +
1094  /// Enable/disable peephole.
+ +
1096  /// Enable/disable the projection layer.
+ +
1098  /// Enable/disable layer normalization
+ +
1100  /// Enable/disable time major
+ +
1102  /// Input intermediate quantization scale
+ +
1104  /// Forget intermediate quantization scale
+ +
1106  /// Cell intermediate quantization scale
+ +
1108  /// Output intermediate quantization scale
+ +
1110  /// Hidden State zero point
+ +
1112  /// Hidden State quantization scale
+ +
1114 };
+
1115 
+ +
1117 
+
1118 /// A MeanDescriptor for the MeanLayer.
+ +
1120 {
+ +
1122  : m_Axis()
+
1123  , m_KeepDims(false)
+
1124  {}
+
1125 
+
1126  MeanDescriptor(const std::vector<unsigned int>& axis, bool keepDims)
+
1127  : m_Axis(axis)
+
1128  , m_KeepDims(keepDims)
+
1129  {}
+
1130 
+
1131  bool operator ==(const MeanDescriptor& rhs) const
+
1132  {
+
1133  return m_Axis == rhs.m_Axis && m_KeepDims == rhs.m_KeepDims;
+
1134  }
+
1135 
+
1136  /// Values for the dimensions to reduce.
+
1137  std::vector<unsigned int> m_Axis;
+
1138  /// Enable/disable keep dimensions. If true, then the reduced dimensions that are of length 1 are kept.
+ +
1140 };
+
1141 
+
1142 /// A PadDescriptor for the PadLayer.
+ +
1144 {
+ +
1146  {}
+
1147 
+
1148  PadDescriptor(const std::vector<std::pair<unsigned int, unsigned int>>& padList,
+
1149  const float& padValue = 0,
+
1150  const PaddingMode& paddingMode = PaddingMode::Constant)
+
1151  : m_PadList(padList)
+
1152  , m_PadValue(padValue)
+
1153  , m_PaddingMode(paddingMode)
+
1154  {}
+
1155 
+
1156  bool operator ==(const PadDescriptor& rhs) const
+
1157  {
+
1158  return m_PadList == rhs.m_PadList && m_PadValue == rhs.m_PadValue && m_PaddingMode == rhs.m_PaddingMode;
+
1159  }
+
1160 
+
1161  /// @brief Specifies the padding for input dimension.
+
1162  /// First is the number of values to add before the tensor in the dimension.
+
1163  /// Second is the number of values to add after the tensor in the dimension.
+
1164  /// The number of pairs should match the number of dimensions in the input tensor.
+
1165  std::vector<std::pair<unsigned int, unsigned int>> m_PadList;
+
1166 
+
1167  /// Optional value to use for padding, defaults to 0
+
1168  float m_PadValue;
+
1169 
+
1170  /// Specifies the Padding mode (Constant, Reflect or Symmetric)
+ +
1172 };
+
1173 
+
1174 /// A SliceDescriptor for the SliceLayer.
+ +
1176 {
+
1177  SliceDescriptor(const std::vector<unsigned int>& begin, const std::vector<unsigned int>& size)
+
1178  : m_Begin(begin)
+
1179  , m_Size(size)
+
1180  {}
+
1181 
+ +
1183  {}
+
1184 
+
1185  bool operator ==(const SliceDescriptor& rhs) const
+
1186  {
+
1187  return m_Begin == rhs.m_Begin && m_Size == rhs.m_Size;
+
1188  }
+
1189 
+
1190  /// Beginning indices of the slice in each dimension.
+
1191  std::vector<unsigned int> m_Begin;
+
1192 
+
1193  /// Size of the slice in each dimension.
+
1194  std::vector<unsigned int> m_Size;
+
1195 };
+
1196 
+
1197 /// A StackDescriptor for the StackLayer.
+ +
1199 {
+ +
1201  : m_Axis(0)
+
1202  , m_NumInputs(0)
+
1203  , m_InputShape()
+
1204  {}
+
1205 
+
1206  StackDescriptor(uint32_t axis, uint32_t numInputs, const TensorShape& inputShape)
+
1207  : m_Axis(axis)
+
1208  , m_NumInputs(numInputs)
+
1209  , m_InputShape(inputShape)
+
1210  {}
+
1211 
+
1212  bool operator ==(const StackDescriptor& rhs) const
+
1213  {
+
1214  return m_Axis == rhs.m_Axis &&
+
1215  m_NumInputs == rhs.m_NumInputs &&
+
1216  m_InputShape == rhs.m_InputShape;
+
1217  }
+
1218 
+
1219  /// 0-based axis along which to stack the input tensors.
+
1220  uint32_t m_Axis;
+
1221  /// Number of input tensors.
+
1222  uint32_t m_NumInputs;
+
1223  /// Required shape of all input tensors.
+ +
1225 };
+
1226 
+
1227 /// A StandInDescriptor for the StandIn layer
+ +
1229 {
+ +
1231 
+
1232  StandInDescriptor(uint32_t numInputs, uint32_t numOutputs)
+
1233  : m_NumInputs(numInputs)
+
1234  , m_NumOutputs(numOutputs)
+
1235  {}
+
1236 
+
1237  bool operator ==(const StandInDescriptor& rhs) const
+
1238  {
+
1239  return m_NumInputs == rhs.m_NumInputs &&
+
1240  m_NumOutputs == rhs.m_NumOutputs;
+
1241  }
+
1242 
+
1243  /// Number of input tensors
+
1244  uint32_t m_NumInputs = 0;
+
1245  /// Number of output tensors
+
1246  uint32_t m_NumOutputs = 0;
+
1247 };
+
1248 
+
1249 /// A StridedSliceDescriptor for the StridedSliceLayer.
+ +
1251 {
+
1252  StridedSliceDescriptor(const std::vector<int>& begin,
+
1253  const std::vector<int>& end,
+
1254  const std::vector<int>& stride)
+
1255  : m_Begin(begin)
+
1256  , m_End(end)
+
1257  , m_Stride(stride)
+
1258  , m_BeginMask(0)
+
1259  , m_EndMask(0)
+
1260  , m_ShrinkAxisMask(0)
+
1261  , m_EllipsisMask(0)
+
1262  , m_NewAxisMask(0)
+ +
1264  {}
+
1265 
+ +
1267  : StridedSliceDescriptor({}, {}, {})
+
1268  {}
+
1269 
+
1270  bool operator ==(const StridedSliceDescriptor& rhs) const
+
1271  {
+
1272  return m_Begin == rhs.m_Begin &&
+
1273  m_End == rhs.m_End &&
+
1274  m_Stride == rhs.m_Stride &&
+
1275  m_BeginMask == rhs.m_BeginMask &&
+
1276  m_EndMask == rhs.m_EndMask &&
+ +
1278  m_EllipsisMask == rhs.m_EllipsisMask &&
+
1279  m_NewAxisMask == rhs.m_NewAxisMask &&
+
1280  m_DataLayout == rhs.m_DataLayout;
+
1281  }
+
1282 
+
1283  int GetStartForAxis(const TensorShape& inputShape, unsigned int axis) const;
+
1284  int GetStopForAxis(const TensorShape& inputShape,
+
1285  unsigned int axis,
+
1286  int startForAxis) const;
+
1287 
+
1288  /// Begin values for the input that will be sliced.
+
1289  std::vector<int> m_Begin;
+
1290  /// End values for the input that will be sliced.
+
1291  std::vector<int> m_End;
+
1292  /// Stride values for the input that will be sliced.
+
1293  std::vector<int> m_Stride;
+
1294 
+
1295  /// @brief Begin mask value. If set, then the begin is disregarded and the fullest
+
1296  /// range is used for the dimension.
+
1297  int32_t m_BeginMask;
+
1298  /// @brief End mask value. If set, then the end is disregarded and the fullest range
+
1299  /// is used for the dimension.
+
1300  int32_t m_EndMask;
+
1301  /// Shrink axis mask value. If set, the nth specification shrinks the dimensionality by 1.
+ +
1303  /// Ellipsis mask value.
+ +
1305  /// @brief New axis mask value. If set, the begin, end and stride is disregarded and
+
1306  /// a new 1 dimension is inserted to this location of the output tensor.
+
1307  int32_t m_NewAxisMask;
+
1308 
+
1309  /// The data layout to be used (NCHW, NHWC).
+ +
1311 };
+
1312 
+
1313 /// A PreCompiledDescriptor for the PreCompiledLayer.
+ +
1315 {
+
1316  PreCompiledDescriptor(unsigned int numInputSlots = 1u, unsigned int numOutputSlots = 1u)
+
1317  : m_NumInputSlots(numInputSlots), m_NumOutputSlots(numOutputSlots)
+
1318  {}
+
1319 
+
1320  ~PreCompiledDescriptor() = default;
+
1321 
+
1322  unsigned int m_NumInputSlots;
+
1323  unsigned int m_NumOutputSlots;
+
1324 };
+
1325 
+
1326 /// A QLstmDescriptor for the QLstmLayer.
+ +
1328 {
+ +
1330  : m_CellClip(0.0)
+
1331  , m_ProjectionClip(0.0)
+
1332  , m_CifgEnabled(true)
+
1333  , m_PeepholeEnabled(false)
+
1334  , m_ProjectionEnabled(false)
+
1335  , m_LayerNormEnabled(false)
+ + + + + +
1341  , m_HiddenStateScale(0.0)
+
1342  {}
+
1343 
+
1344  bool operator ==(const QLstmDescriptor& rhs) const
+
1345  {
+
1346  return m_CellClip == rhs.m_CellClip &&
+ +
1348  m_CifgEnabled == rhs.m_CifgEnabled &&
+ + + + + + + + + +
1358  }
+
1359 
+
1360  /// Clipping threshold value for the cell state
+
1361  float m_CellClip;
+
1362  /// Clipping threshold value for the projection
+ +
1364  /// Enable/disable CIFG (coupled input & forget gate).
+ +
1366  /// Enable/disable peephole
+ +
1368  /// Enable/disable the projection layer
+ +
1370  /// Enable/disable layer normalization
+ +
1372  /// Input intermediate quantization scale
+ +
1374  /// Forget intermediate quantization scale
+ +
1376  /// Cell intermediate quantization scale
+ +
1378  /// Output intermediate quantization scale
+ +
1380  /// Hidden State zero point
+ +
1382  /// Hidden State quantization scale
+ +
1384 };
+
1385 
+
1386 /// A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
+ +
1388 {
+ +
1390  m_PadLeft(0),
+
1391  m_PadRight(0),
+
1392  m_PadTop(0),
+
1393  m_PadBottom(0),
+
1394  m_StrideX(0),
+
1395  m_StrideY(0),
+
1396  m_BiasEnabled(false),
+ +
1398  m_OutputShapeEnabled(false)
+
1399  {}
+
1400 
+ +
1402  {
+
1403  return m_PadLeft == rhs.m_PadLeft &&
+
1404  m_PadRight == rhs.m_PadRight &&
+
1405  m_PadTop == rhs.m_PadTop &&
+
1406  m_PadBottom == rhs.m_PadBottom &&
+
1407  m_StrideX == rhs.m_StrideX &&
+
1408  m_StrideY == rhs.m_StrideY &&
+
1409  m_BiasEnabled == rhs.m_BiasEnabled &&
+
1410  m_DataLayout == rhs.m_DataLayout &&
+ + +
1413  }
+
1414 
+
1415  /// Padding left value in the width dimension.
+
1416  uint32_t m_PadLeft;
+
1417  /// Padding right value in the width dimension.
+
1418  uint32_t m_PadRight;
+
1419  /// Padding top value in the height dimension.
+
1420  uint32_t m_PadTop;
+
1421  /// Padding bottom value in the height dimension.
+
1422  uint32_t m_PadBottom;
+
1423  /// Stride value when proceeding through input for the width dimension.
+
1424  uint32_t m_StrideX;
+
1425  /// Stride value when proceeding through input for the height dimension.
+
1426  uint32_t m_StrideY;
+
1427  /// Enable/disable bias.
+ +
1429  /// The data layout to be used (NCHW, NHWC).
+ +
1431  /// Output shape if it has been specified.
+ +
1433  std::vector<unsigned int> m_OutputShape;
+
1434 };
+
1435 
+
1436 /// A TransposeDescriptor for the TransposeLayer.
+ +
1438 {
+ +
1440  : m_DimMappings{}
+
1441  {}
+
1442 
+ +
1444  : m_DimMappings(dimMappings)
+
1445  {}
+
1446 
+
1447  bool operator ==(const TransposeDescriptor &rhs) const
+
1448  {
+
1449  return m_DimMappings.IsEqual(rhs.m_DimMappings);
+
1450  }
+
1451 
+
1452  /// @brief Indicates how to translate tensor elements from a given source into the target destination, when
+
1453  /// source and target potentially have different memory layouts e.g.
+
1454  /// Input Shape {1, 1, 4, 4}
+
1455  /// Permutation Vector {0, 2, 3, 1}
+
1456  /// Output Shape {1, 4, 4, 1}
+
1457  /// dim "0" of input goes into index 0 ([ 1, X, X, X])
+
1458  /// dim "2" of input goes into index 1 ([ 1, 4, X, X ])
+
1459  /// dim "3" of input goes into index 2 ([ 1, 4, 4, X ])
+
1460  /// dim "1" of input goes into index 3 ([ 1, 4, 4, 1 ])
+ +
1462 };
+
1463 
+
1464 /// A LogicalBinaryDescriptor for the LogicalBinaryLayer
+ +
1466 {
+ + +
1469  {}
+
1470 
+ +
1472  : m_Operation(operation)
+
1473  {}
+
1474 
+
1475  bool operator ==(const LogicalBinaryDescriptor &rhs) const
+
1476  {
+
1477  return m_Operation == rhs.m_Operation;
+
1478  }
+
1479 
+
1480  /// Specifies the logical operation to execute
+ +
1482 };
+
1483 
+
1484 /// A ReduceDescriptor for the REDUCE operators.
+ +
1486 {
+ +
1488  : m_KeepDims(false)
+
1489  , m_vAxis()
+ +
1491  {}
+
1492 
+
1493  bool operator ==(const ReduceDescriptor& rhs) const
+
1494  {
+
1495  return m_KeepDims == rhs.m_KeepDims &&
+
1496  m_vAxis == rhs.m_vAxis &&
+ +
1498  }
+
1499 
+
1500  /// if true then output shape has no change.
+ +
1502  /// The indices of the dimensions to reduce.
+
1503  std::vector<uint32_t> m_vAxis;
+
1504  /// Specifies the reduction operation to execute
+ +
1506 };
+
1507 
+
1508 /// A ChannelShuffleDescriptor for the ChannelShuffle operator
+ +
1510 {
+ +
1512  : m_NumGroups(0), m_Axis(0)
+
1513  {}
+
1514 
+
1515  ChannelShuffleDescriptor(const uint32_t& numGroups, const uint32_t& axis)
+
1516  : m_NumGroups(numGroups), m_Axis(axis)
+
1517  {}
+
1518 
+
1519  bool operator ==(const ChannelShuffleDescriptor& rhs) const
+
1520  {
+
1521  return m_NumGroups == rhs.m_NumGroups;
+
1522  }
+
1523 
+
1524  /// Number of groups for the channel shuffle operation
+
1525  uint32_t m_NumGroups;
+
1526  /// Axis to apply channel shuffle operation on
+
1527  uint32_t m_Axis;
+
1528 };
+
1529 
+
1530 /// A BatchMatMulDescriptor for the BatchMatMul operator
+ +
1532 {
+
1533  BatchMatMulDescriptor(bool transposeX = false,
+
1534  bool transposeY = false,
+
1535  bool adjointX = false,
+
1536  bool adjointY = false,
+
1537  DataLayout dataLayoutX = DataLayout::NCHW,
+
1538  DataLayout dataLayoutY = DataLayout::NCHW)
+
1539  : m_TransposeX(transposeX)
+
1540  , m_TransposeY(transposeY)
+
1541  , m_AdjointX(adjointX)
+
1542  , m_AdjointY(adjointY)
+
1543  , m_DataLayoutX(dataLayoutX)
+
1544  , m_DataLayoutY(dataLayoutY)
+
1545  {}
+
1546 
+
1547  bool operator ==(const BatchMatMulDescriptor &rhs) const
+
1548  {
+
1549  return m_TransposeX == rhs.m_TransposeX &&
+
1550  m_TransposeY == rhs.m_TransposeY &&
+
1551  m_AdjointX == rhs.m_AdjointX &&
+
1552  m_AdjointY == rhs.m_AdjointY &&
+
1553  m_DataLayoutX == rhs.m_DataLayoutX &&
+ +
1555  }
+
1556 
+
1557  /// Transpose the slices of each input tensor
+
1558  /// Transpose and Adjoint can not both be set to true for the same tensor at the same time
+ + +
1561 
+
1562  /// Adjoint the slices of each input tensor
+
1563  /// Transpose and Adjoint can not both be set to true for the same tensor at the same time
+ + +
1566 
+
1567  /// Data layout of each input tensor, such as NHWC/NDHWC (leave as default for arbitrary layout)
+ + +
1570 
+
1571  ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This method is deprecated. Use ABI Stable "
+
1572  "GetAxesToMul(DataLayout dataLayout, const TensorShape& tensorShape) instead.",
+
1573  "23.05")
+
1574  static std::pair<std::pair<unsigned int, unsigned int>, std::pair<unsigned int, unsigned int>> GetAxesToMul(
+
1575  const BatchMatMulDescriptor& desc,
+
1576  const TensorShape& tensorXShape,
+
1577  const TensorShape& tensorYShape);
+
1578 
+
1579  ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This method is deprecated. Use ABI Stable "
+
1580  "GetAxesNotMul(DataLayout dataLayout, const TensorShape& tensorShape) instead.",
+
1581  "23.05")
+
1582  static std::pair<std::vector<unsigned int>, std::vector<unsigned int>> GetAxesNotMul(
+
1583  const BatchMatMulDescriptor& desc,
+
1584  const TensorShape& inputXShape,
+
1585  const TensorShape& inputYShape);
+
1586 
+
1587  /// Static helper to get the two axes (for each input) for multiplication
+
1588  static std::pair<unsigned int, unsigned int> GetAxesToMul(
+
1589  DataLayout dataLayout,
+
1590  const TensorShape& tensorShape);
+
1591 
+
1592  /// Static helper to get the axes (for each input) that will not be multiplied together
+
1593  static std::vector<unsigned int> GetAxesNotMul(
+
1594  DataLayout dataLayout,
+
1595  const TensorShape& tensorShape);
+
1596 
+
1597  /// Static helper to get the axes which will be transposed
+ +
1599  DataLayout dataLayout,
+
1600  const TensorShape& tensorShape);
+
1601 };
+
1602 
+
1603 } // namespace armnn
+
ViewsDescriptor & operator=(ViewsDescriptor rhs)
+
float m_CellClip
Clipping threshold value for the cell state.
+
bool m_LayerNormEnabled
Enable/disable layer normalization.
+ +
bool m_OutputShapeEnabled
Output shape if it has been specified.
+ +
LogicalBinaryDescriptor(LogicalBinaryOperation operation)
+
uint32_t m_PadTop
Padding top value in the height dimension.
+
ChannelShuffleDescriptor(const uint32_t &numGroups, const uint32_t &axis)
+
float m_Eps
Epsilon, small scalar value added to variance to avoid dividing by zero. Defaults to 1e-12f.
+
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
+
ComparisonDescriptor(ComparisonOperation operation)
Definition: Descriptors.hpp:95
+
Null Descriptor used as a return value from the IConnectableLayer GetParameters method by layers whic...
Definition: Descriptors.hpp:30
+ +
float m_Eps
Used to avoid dividing by zero.
+
bool operator==(const StandInDescriptor &rhs) const
+
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+
NormalizationAlgorithmMethod
Definition: Types.hpp:199
+
bool m_TimeMajor
Enable/disable time major.
+
TensorShape m_InputShape
Required shape of all input tensors.
+
OutputShapeRounding
Definition: Types.hpp:207
+
bool m_TransposeX
Transpose the slices of each input tensor Transpose and Adjoint can not both be set to true for the s...
+
uint32_t m_PadBottom
Padding bottom value in the height dimension.
+ +
bool m_BiasEnabled
Enable/disable bias.
+
bool operator==(const PadDescriptor &rhs) const
+
bool operator==(const FakeQuantizationDescriptor &rhs) const
+
uint32_t GetNumViews() const
Get the number of views.
+ +
float m_ProjectionClip
Clipping threshold value for the projection.
+
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
+
const uint32_t * GetViewOrigin(uint32_t idx) const
Get the view origin at the int value idx.
+
uint32_t m_PadLeft
Padding left value in the width dimension.
+ +
bool m_BiasEnabled
Enable/disable bias.
+
NormalizationAlgorithmChannel
Definition: Types.hpp:193
+
A GatherDescriptor for the GatherLayer.
+
A NormalizationDescriptor for the NormalizationLayer.
+ +
A TransposeDescriptor for the TransposeLayer.
+
float m_ForgetIntermediateScale
Forget intermediate quantization scale.
+
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+
bool operator==(const SliceDescriptor &rhs) const
+
uint32_t m_PadTop
Padding top value in the height dimension.
+
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
+
StandInDescriptor(uint32_t numInputs, uint32_t numOutputs)
+
A PadDescriptor for the PadLayer.
+
StackDescriptor(uint32_t axis, uint32_t numInputs, const TensorShape &inputShape)
+ +
DataLayout
Definition: Types.hpp:62
+
A SoftmaxDescriptor for the SoftmaxLayer.
+
uint32_t GetNumViews() const
Get the number of views.
+ + +
uint32_t m_DilationY
Dilation along y axis.
+ +
ComparisonOperation m_Operation
Specifies the comparison operation to execute.
+
uint32_t m_PadBottom
Padding bottom value in the height dimension.
+
A StackDescriptor for the StackLayer.
+
A SliceDescriptor for the SliceLayer.
+
uint32_t GetNumDimensions() const
Get the number of dimensions.
+
ActivationDescriptor(armnn::ActivationFunction activation, float a=0, float b=0)
Definition: Descriptors.hpp:44
+
std::vector< std::pair< unsigned int, unsigned int > > m_Crops
The values to crop from the input dimension.
+
uint32_t m_PadLeft
Padding left value in the width dimension.
+ + +
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:36
+
ReduceOperation m_ReduceOperation
Specifies the reduction operation to execute.
+
bool operator==(const ReshapeDescriptor &rhs) const
+
uint32_t m_PadRight
Padding right value in the width dimension.
+ +
StridedSliceDescriptor(const std::vector< int > &begin, const std::vector< int > &end, const std::vector< int > &stride)
+
An LstmDescriptor for the LstmLayer.
+
A FullyConnectedDescriptor for the FullyConnectedLayer.
+
bool operator==(const ViewsDescriptor &rhs) const
+
int32_t m_BeginMask
Begin mask value.
+
BatchMatMulDescriptor(bool transposeX=false, bool transposeY=false, bool adjointX=false, bool adjointY=false, DataLayout dataLayoutX=DataLayout::NCHW, DataLayout dataLayoutY=DataLayout::NCHW)
+
uint32_t m_NumGroups
Number of groups for the channel shuffle operation.
+
uint32_t m_NumInputs
Number of input tensors.
+
uint32_t m_DilationY
Dilation along y axis.
+
void ReorderOrigins(unsigned int *newOrdering, unsigned int numNewOrdering)
Reorders the viewOrigins in accordance with the indices presented in newOrdering array.
+
std::vector< unsigned int > m_OutputShape
+
int m_Axis
Axis to reduce across the input tensor.
Definition: Descriptors.hpp:83
+
std::vector< std::pair< unsigned int, unsigned int > > m_PadList
Specifies the padding values for the input dimension: heightPad{top, bottom} widthPad{left,...
+ +
A BatchMatMulDescriptor for the BatchMatMul operator.
+
bool operator==(const ComparisonDescriptor &rhs) const
Definition: Descriptors.hpp:99
+
PermutationVector m_DimMappings
Indicates how to translate tensor elements from a given source into the target destination,...
+
uint32_t GetNumInputs() const
Get the number of views/inputs.
+
A ResizeDescriptor for the ResizeLayer.
+
armnn::DataType m_Output_Type
Deprecated and will be removed in future release.
Definition: Descriptors.hpp:85
+
bool m_ConstantWeights
Enable/disable constant weights and biases.
+
A StridedSliceDescriptor for the StridedSliceLayer.
+
uint32_t m_PoolHeight
Pooling height value.
+
std::vector< int > m_Begin
Begin values for the input that will be sliced.
+
bool operator==(const SpaceToDepthDescriptor &rhs) const
+
std::vector< uint32_t > m_vAxis
The indices of the dimensions to reduce.
+
A Pooling3dDescriptor for the Pooling3dLayer.
+
A ReduceDescriptor for the REDUCE operators.
+
bool m_BiasEnabled
Enable/disable bias.
+
const uint32_t * GetViewOrigin(uint32_t idx) const
Return the view origin at the int value idx.
+ +
void SetConcatAxis(unsigned int concatAxis)
Set the concatenation axis value.
+
uint32_t m_DilationX
Dilation along x axis.
+
uint32_t m_MaxDetections
Maximum numbers of detections.
+
friend void swap(OriginsDescriptor &first, OriginsDescriptor &second)
Swap the ViewsDescriptor values first and second.
+
uint32_t m_PoolWidth
Pooling width value.
+
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:89
+
bool operator==(const LstmDescriptor &rhs) const
+
bool operator==(const OriginsDescriptor &rhs) const
+ +
A StandInDescriptor for the StandIn layer.
+
OutputShapeRounding m_OutputShapeRounding
The rounding method for the output shape. (Floor, Ceiling).
+
bool operator==(const StridedSliceDescriptor &rhs) const
+
bool m_CifgEnabled
Enable/disable cifg (coupled input & forget gate).
+
PoolingAlgorithm m_PoolType
The pooling algorithm to use (Max. Average, L2).
+
#define ARMNN_DEPRECATED_MSG_REMOVAL_DATE(message, removed_in_release)
Definition: Deprecated.hpp:44
+
bool m_LayerNormEnabled
Enable/disable layer normalization.
+
LogicalBinaryOperation m_Operation
Specifies the logical operation to execute.
+
bool operator==(const LogicalBinaryDescriptor &rhs) const
+
A ViewsDescriptor for the SplitterLayer.
+
SpaceToDepthDescriptor(unsigned int blockSize, DataLayout dataLayout)
+
bool m_BiasEnabled
Enable/disable bias.
+
std::vector< unsigned int > m_Axis
Values for the dimensions to reduce.
+
float m_ScaleX
Center size encoding scale x.
+
uint32_t m_PadLeft
Padding left 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).
+ +
int32_t m_NewAxisMask
New axis mask value.
+
uint32_t m_PadRight
Padding right value in the width dimension.
+
uint32_t m_DilationX
Dilation along x axis.
+
unsigned int GetConcatAxis() const
Get the concatenation axis value.
+ +
A PreCompiledDescriptor for the PreCompiledLayer.
+
uint32_t m_DilationZ
Dilation along z axis.
+
bool operator==(const SpaceToBatchNdDescriptor &rhs) const
+
bool operator==(const FullyConnectedDescriptor &rhs) const
+
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
+
bool operator==(const InstanceNormalizationDescriptor &rhs) const
+
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
+
ArgMinMaxFunction
Definition: Types.hpp:102
+
uint32_t m_DilationX
Dilation factor value for width dimension.
+ +
float m_NmsScoreThreshold
NMS score threshold.
+
bool operator==(const QLstmDescriptor &rhs) const
+ + +
bool operator==(const L2NormalizationDescriptor &rhs) const
+
float m_InputIntermediateScale
Input intermediate quantization scale.
+
uint32_t GetNumDimensions() const
Get the number of dimensions.
+
NormalizationAlgorithmMethod m_NormMethodType
Normalization method algorithm to use (LocalBrightness, LocalContrast).
+
float m_CellIntermediateScale
Cell intermediate quantization scale.
+
uint32_t m_PadLeft
Padding left value in the width dimension.
+
Copyright (c) 2021 ARM Limited and Contributors.
+
int GetStopForAxis(const TensorShape &inputShape, unsigned int axis, int startForAxis) const
+
uint32_t m_PadTop
Padding top value in the height dimension.
+
uint32_t m_NumOutputs
Number of output tensors.
+ +
float m_OutputIntermediateScale
Output intermediate quantization scale.
+
uint32_t m_DetectionsPerClass
Detections per classes, used in Regular NMS.
+ +
ReshapeDescriptor(const TensorShape &shape)
+
float m_ScaleH
Center size encoding scale height.
+
Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value)
@Brief Set the view origin coordinates.
+
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+
uint32_t m_PadTop
Padding top value in the height dimension.
+
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
+ +
uint32_t m_PadFront
Padding front value in the depth dimension.
+
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
+
std::vector< int > m_End
End values for the input that will be sliced.
+ +
float m_CellIntermediateScale
Cell intermediate quantization scale.
+ +
float m_ScaleW
Center size encoding scale weight.
+
bool m_AlignCorners
Aligned corners.
+
PadDescriptor(const std::vector< std::pair< unsigned int, unsigned int >> &padList, const float &padValue=0, const PaddingMode &paddingMode=PaddingMode::Constant)
+
LogicalBinaryOperation
Definition: Types.hpp:118
+
+
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
+
friend void swap(ViewsDescriptor &first, ViewsDescriptor &second)
Swap the ViewsDescriptor value first and second.
+ +
bool operator==(const BatchToSpaceNdDescriptor &rhs) const
+ +
A FillDescriptor for the FillLayer.
+
uint32_t m_StrideZ
Stride value when proceeding through input for the depth dimension.
+
bool operator==(const ActivationDescriptor &rhs) const
Definition: Descriptors.hpp:52
+
PoolingAlgorithm
Definition: Types.hpp:136
+
ResizeMethod
Definition: Types.hpp:152
+ +
PaddingMode m_PaddingMode
Specifies the Padding mode (Constant, Reflect or Symmetric)
+
uint32_t m_TargetHeight
Target height value.
+
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+
uint32_t m_DilationY
Dilation factor value for height dimension.
+
int32_t m_Axis
The axis in params to gather indices from.
+ +
uint32_t m_PadFront
Padding front value in the depth dimension.
+
ReduceOperation
Definition: Types.hpp:143
+
bool operator==(const BatchMatMulDescriptor &rhs) const
+
ArgMinMaxFunction m_Function
Specify if the function is to find Min or Max.
Definition: Descriptors.hpp:81
+ +
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+
int m_Axis
Scalar, defaulted to the last index (-1), specifying the dimension the activation will be performed o...
+
float m_HiddenStateScale
Hidden State quantization scale.
+
std::vector< std::pair< unsigned int, unsigned int > > m_PadList
Specifies the padding for input dimension.
+ +
uint32_t m_PadLeft
Padding left value in the width dimension.
+
DataLayout m_DataLayoutX
Data layout of each input tensor, such as NHWC/NDHWC (leave as default for arbitrary layout)
+
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
+ +
A MeanDescriptor for the MeanLayer.
+
@ LocalBrightness
Krichevsky 2012: Local Brightness Normalization.
+ +
bool operator==(const BatchNormalizationDescriptor &rhs) const
+
int32_t m_HiddenStateZeroPoint
Hidden State zero point.
+
bool operator==(const FillDescriptor &rhs) const
+
uint32_t m_NormSize
Depth radius value.
+ +
uint32_t m_PadBack
Padding back value in the depth 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_StrideZ
Stride value when proceeding through input for the depth dimension.
+ +
bool operator==(const Convolution2dDescriptor &rhs) const
+ +
uint32_t m_Axis
Axis to apply channel shuffle operation on.
+
bool operator==(const Pooling2dDescriptor &rhs) const
+
MeanDescriptor(const std::vector< unsigned int > &axis, bool keepDims)
+
A L2NormalizationDescriptor for the L2NormalizationLayer.
+ + +
virtual ~BaseDescriptor()=default
+
PermuteDescriptor(const PermutationVector &dimMappings)
+
A ChannelShuffleDescriptor for the ChannelShuffle operator.
+
A Convolution3dDescriptor for the Convolution3dLayer.
+
bool m_PeepholeEnabled
Enable/disable peephole.
+ +
ComparisonOperation
Definition: Types.hpp:108
+ +
PaddingMode
The padding mode controls whether the padding should be filled with constant values (Constant),...
Definition: Types.hpp:186
+
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+ +
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 Convolution2dDescriptor for the Convolution2dLayer.
+
UnaryOperation
Definition: Types.hpp:124
+
bool operator==(const NormalizationDescriptor &rhs) const
+
uint32_t m_NumInputs
Number of input tensors.
+
uint32_t m_PoolWidth
Pooling width value.
+
uint32_t m_PadRight
Padding right value in the width dimension.
+
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
+
GatherDescriptor(int32_t axis)
+
FillDescriptor(const float &value)
+ +
PoolingAlgorithm m_PoolType
The pooling algorithm to use (Max. Average, L2).
+ +
A QLstmDescriptor for the QLstmLayer.
+
float m_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH,...
Definition: Descriptors.hpp:61
+
bool operator==(const MeanDescriptor &rhs) const
+
uint32_t m_PoolDepth
Pooling depth value.
+
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
+
PaddingMethod m_PaddingMethod
The padding method to be used. (Exclude, IgnoreValue).
+
BatchToSpaceNdDescriptor(std::vector< unsigned int > blockShape, std::vector< std::pair< unsigned int, unsigned int >> crops)
+ +
Status
Definition: Types.hpp:42
+
float m_Beta
Exponentiation value.
+
int GetStartForAxis(const TensorShape &inputShape, unsigned int axis) const
+ + +
float m_OutputIntermediateScale
Output intermediate quantization scale.
+
ResizeMethod m_Method
The Interpolation method to use (Bilinear, NearestNeighbor).
+
ElementwiseUnaryDescriptor(UnaryOperation operation)
+
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.
+
float m_HiddenStateScale
Hidden State quantization scale.
+
PermutationVector m_DimMappings
Indicates how to translate tensor elements from a given source into the target destination,...
+
uint32_t m_PadRight
Padding right value in the width dimension.
+
PaddingMethod
The padding method modifies the output of pooling layers.
Definition: Types.hpp:174
+
int32_t m_HiddenStateZeroPoint
Hidden State zero point.
+ +
std::vector< int > m_Stride
Stride values for the input that will be sliced.
+ +
float m_ForgetIntermediateScale
Forget intermediate quantization scale.
+
bool operator==(const ReduceDescriptor &rhs) const
+
SliceDescriptor(const std::vector< unsigned int > &begin, const std::vector< unsigned int > &size)
+
uint32_t m_NumClasses
Number of classes.
+
uint32_t m_PadTop
Padding top value in the height dimension.
+
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu,...
Definition: Descriptors.hpp:59
+
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
+
float m_K
Kappa value used for the across channel normalization equation.
+
DataLayout m_DataLayout
The data layout to be used (NDHWC, NCDHW).
+
bool operator==(const TransposeConvolution2dDescriptor &rhs) const
+ +
float m_PadValue
Optional value to use for padding, defaults to 0.
+ +
std::vector< unsigned int > m_BlockShape
Block shape values.
+
int32_t m_ShrinkAxisMask
Shrink axis mask value. If set, the nth specification shrinks the dimensionality by 1.
+
std::vector< unsigned int > m_BlockShape
Block shape value.
+
float m_Beta
Beta value for the normalization equation.
+ +
std::vector< unsigned int > m_Size
Size of the slice in each dimension.
+
float m_ClippingThresCell
Clipping threshold value for the cell state.
+
Base class for all descriptors.
Definition: Descriptors.hpp:22
+
An OriginsDescriptor for the ConcatLayer.
+
A ReshapeDescriptor for the ReshapeLayer.
+
bool operator==(const SoftmaxDescriptor &rhs) const
+
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+
Status SetViewSize(uint32_t view, uint32_t coord, uint32_t value)
Set the size of the views.
+
virtual bool IsNull() const
Definition: Descriptors.hpp:24
+
DataType
Definition: Types.hpp:48
+
A PermuteDescriptor for the PermuteLayer.
+ + +
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
+
bool m_TransposeWeightMatrix
Enable/disable transpose weight matrix.
+ +
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+
bool IsEqual(const PermutationVector &other) const
Definition: Types.hpp:347
+
std::vector< unsigned int > m_Begin
Beginning indices of the slice in each dimension.
+
bool operator==(const TransposeDescriptor &rhs) const
+
uint32_t m_PadRight
Padding right value in the width dimension.
+ +
A Pooling2dDescriptor for the Pooling2dLayer.
+ +
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
+
uint32_t m_PadBottom
Padding bottom value in the height dimension.
+
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
+
bool m_ProjectionEnabled
Enable/disable the projection layer.
+ + +
float m_InputIntermediateScale
Input intermediate quantization scale.
+
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+
bool m_KeepDims
Enable/disable keep dimensions. If true, then the reduced dimensions that are of length 1 are kept.
+
const OriginsDescriptor & GetOrigins() const
Get the View Origins.
+
uint32_t m_PadRight
Padding right value in the width dimension.
+
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
+
TransposeDescriptor(const PermutationVector &dimMappings)
+
float m_ScaleY
Center size encoding scale y.
+
bool m_CifgEnabled
Enable/disable CIFG (coupled input & forget gate).
+ +
SpaceToBatchNdDescriptor(const std::vector< unsigned int > &blockShape, const std::vector< std::pair< unsigned int, unsigned int >> &padList)
+
uint32_t m_MaxClassesPerDetection
Maximum numbers of classes per detection, used in Fast NMS.
+ +
int32_t m_EndMask
End mask value.
+
uint32_t m_PadBottom
Padding bottom value in the height dimension.
+
float m_Gamma
Gamma, the scale scalar value applied for the normalized tensor. Defaults to 1.0.
+
bool operator==(const DepthwiseConvolution2dDescriptor &rhs) const
+
NormalizationAlgorithmChannel m_NormChannelType
Normalization channel algorithm to use (Across, Within).
+
bool m_BiasEnabled
Enable/disable bias.
+
uint32_t m_ActivationFunc
The activation function to use.
+
OriginsDescriptor CreateDescriptorForConcatenation(TensorShapeIt first, TensorShapeIt last, unsigned int concatenationDimension)
Convenience template to create an OriginsDescriptor to use when creating a ConcatLayer for performing...
+
float m_ClippingThresProj
Clipping threshold value for the projection.
+
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:67
+
bool operator==(const ChannelShuffleDescriptor &rhs) const
+
bool m_PeepholeEnabled
Enable/disable peephole.
+
float m_Eps
Value to add to the variance. Used to avoid dividing by zero.
+
A FakeQuantizationDescriptor for the FakeQuantizationLayer.
+ +
uint32_t m_PoolHeight
Pooling height value.
+
float m_B
Beta lower bound value used by the activation functions. (BoundedReLu, Linear, TanH).
Definition: Descriptors.hpp:63
+
bool operator==(const StackDescriptor &rhs) const
+
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
+
bool operator==(const GatherDescriptor &rhs) const
+
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
+
uint32_t m_PadBack
Padding back value in the depth dimension.
+
PaddingMethod m_PaddingMethod
The padding method to be used. (Exclude, IgnoreValue).
+ +
bool m_KeepDims
if true then output shape has no change.
+ + +
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
+ +
bool m_HalfPixelCenters
Half Pixel Centers.
+
@ Exclude
The padding fields don't count and are ignored.
+
float m_NmsIouThreshold
Intersection over union threshold.
+
TensorShape m_TargetShape
Target shape value.
+ +
bool operator==(const Pooling3dDescriptor &rhs) const
+
bool operator==(const Convolution3dDescriptor &rhs) const
+
static PermutationVector GetPermuteVec(DataLayout dataLayout, const TensorShape &tensorShape)
Static helper to get the axes which will be transposed.
+ + +
bool m_AdjointX
Adjoint the slices of each input tensor Transpose and Adjoint can not both be set to true for the sam...
+
DataLayout m_DataLayout
The data layout to be used (NCDHW, NDHWC).
+
uint32_t m_Axis
0-based axis along which to stack the input tensors.
+
uint32_t GetNumInputs() const
Get the number of views/inputs.
+
bool m_ProjectionEnabled
Enable/disable the projection layer.
+
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
+
float m_Alpha
Alpha value for the normalization equation.
+
DetectionPostProcessDescriptor()
+
bool m_UseRegularNms
Use Regular NMS.
+
bool operator==(const ArgMinMaxDescriptor &rhs) const
Definition: Descriptors.hpp:75
+
bool IsNull() const override
Definition: Descriptors.hpp:32
+
bool operator==(const PermuteDescriptor &rhs) const
+
bool operator==(const DetectionPostProcessDescriptor &rhs) const
+
bool operator==(const ResizeDescriptor &rhs) const
+
uint32_t m_PadBottom
Padding bottom value in the height dimension.
+
static std::pair< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > GetAxesToMul(const BatchMatMulDescriptor &desc, const TensorShape &tensorXShape, const TensorShape &tensorYShape)
+
Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value)
@Brief Set the view origin coordinates.
+
OriginsDescriptor & operator=(OriginsDescriptor rhs)
+
int32_t m_EllipsisMask
Ellipsis mask value.
+ +
uint32_t GetNumInputs() const
Get the number of inputs.
+ + +
PreCompiledDescriptor(unsigned int numInputSlots=1u, unsigned int numOutputSlots=1u)
+
const uint32_t * GetViewSizes(uint32_t idx) const
Get the view sizes at the int value idx.
+
static std::pair< std::vector< unsigned int >, std::vector< unsigned int > > GetAxesNotMul(const BatchMatMulDescriptor &desc, const TensorShape &inputXShape, const TensorShape &inputYShape)
+
float m_Beta
Beta, the offset scalar value applied for the normalized tensor. Defaults to 1.0.
+
uint32_t m_TargetWidth
Target width value.
+ +
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
+
bool operator==(const ElementwiseUnaryDescriptor &rhs) const
+
OutputShapeRounding m_OutputShapeRounding
The rounding method for the output shape. (Floor, Ceiling).
+
ActivationFunction
Definition: Types.hpp:86
-- cgit v1.2.1