Compute Library
 23.08
Types.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2023 Arm Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef ACL_ARM_COMPUTE_CORE_TYPES
25 #define ACL_ARM_COMPUTE_CORE_TYPES
26 
27 /** The following symbols have been moved to:
28  * half
29  * PermutationVector
30  * Format
31  * DataType
32  * DataLayout
33  * DataLayoutDimension
34  * PadStrideInfo
35  * WeightFormat
36  * Channel
37  * DimensionRoundingType
38  */
40 /** The following symbols have been moved to:
41  * ActivationFunction
42  * ActivationLayerInfo
43  */
45 /** The following symbols have been moved to:
46  * ConvolutionInfo
47  */
49 /** The following symbols have been moved to:
50  * FullyConnectedLayerInfo
51  */
53 /** The following symbols have been moved to:
54  * GEMMLowpOutputStageType
55  * GEMMLowpOutputStageInfo
56  * GEMMInfo
57  */
59 /** The following symbols have been moved to:
60  * MatMulInfo
61  */
63 
70 #include "support/Bfloat16.h"
71 
72 #include <cmath>
73 #include <cstddef>
74 #include <cstdint>
75 #include <map>
76 #include <string>
77 #include <utility>
78 
79 namespace arm_compute
80 {
81 /** Bidirectional strides */
83 
84 /** Available Sampling Policies */
85 enum class SamplingPolicy
86 {
87  CENTER, /**< Samples are taken at pixel center */
88  TOP_LEFT /**< Samples are taken at pixel top left corner */
89 };
90 
91 /** Available ConvolutionMethod*/
93 {
94  GEMM, /**< Convolution using GEMM */
95  GEMM_CONV2D, /**< Direct 2D GEMM convolution */
96  DIRECT, /**< Direct convolution */
97  INDIRECT, /**< Indirect convolution */
98  WINOGRAD, /**< Convolution using Winograd */
99  FFT /**< Convolution using FFT */
100 };
101 
102 /** Available DepthwiseConvolutionFunction*/
104 {
105  OPTIMIZED, /**< Optimized Depthwise Convolution */
106  GENERIC, /**< Generic Depthwise Convolution */
107 };
108 
109 /** Available DeconvolutionMethod*/
111 {
112  GEMM, /**< Deconvolution using GEMM */
113  DIRECT, /**< Direct deconvolution */
114  UPSCALE_CONV2D /**< Deconvolution with Upscaling */
115 };
116 
117 /** Available FuseBatchNormalizationType*/
119 {
120  CONVOLUTION, /**< For Convolution weights */
121  DEPTHWISECONVOLUTION /**< For Depthwise Convolution weights*/
122 };
123 
124 /** Padding mode to use for PadLayer */
125 enum class PaddingMode
126 {
127  CONSTANT,
128  REFLECT,
129  SYMMETRIC
130 };
131 
132 /** Supported comparison operations */
134 {
135  Equal, /**< Equal comparison ( \f$ x == y \f$ ) */
136  NotEqual, /**< NotEqual comparison ( \f$ x != y \f$ ) */
137  Greater, /**< Greater comparison ( \f$ x > y \f$ ) */
138  GreaterEqual, /**< Greater equal comparison ( \f$ x >= y \f$ ) */
139  Less, /**< Less comparison ( \f$ x < y \f$ ) */
140  LessEqual /**< Less equal comparison ( \f$ x <= y \f$ ) */
141 };
142 
143 /** Container for valid region of a window */
145 {
146  /** Default constructor */
148  : anchor{}, shape{}
149  {
150  }
151 
152  /** Allow instances of this class to be copy constructed */
153  ValidRegion(const ValidRegion &) = default;
154  /** Allow instances of this class to be move constructed */
155  ValidRegion(ValidRegion &&) = default;
156  /** Allow instances of this class to be copied */
157  ValidRegion &operator=(const ValidRegion &) = default;
158  /** Allow instances of this class to be moved */
159  ValidRegion &operator=(ValidRegion &&) = default;
160  /** Default destructor */
161  ~ValidRegion() = default;
162 
163  /** Constructor for a valid region with default number of dimensions
164  *
165  * @param[in] an_anchor Anchor for the start of the valid region.
166  * @param[in] a_shape Shape of the valid region.
167  *
168  */
169  ValidRegion(const Coordinates &an_anchor, const TensorShape &a_shape)
170  : anchor{ an_anchor }, shape{ a_shape }
171  {
173  }
174 
175  /** Constructor for a valid region with specified number of dimensions
176  *
177  * @param[in] an_anchor Anchor for the start of the valid region.
178  * @param[in] a_shape Shape of the valid region.
179  * @param[in] num_dimensions Number of dimensions (must be >= number of dimensions of anchor and shape).
180  *
181  */
182  ValidRegion(const Coordinates &an_anchor, const TensorShape &a_shape, size_t num_dimensions)
183  : anchor{ an_anchor }, shape{ a_shape }
184  {
185  ARM_COMPUTE_ERROR_ON(num_dimensions < std::max(anchor.num_dimensions(), shape.num_dimensions()));
186  anchor.set_num_dimensions(num_dimensions);
187  }
188 
189  /** Return the start of the valid region for the given dimension @p d */
190  int start(unsigned int d) const
191  {
192  return anchor[d];
193  }
194 
195  /** Return the end of the valid region for the given dimension @p d */
196  int end(unsigned int d) const
197  {
198  return anchor[d] + shape[d];
199  }
200 
201  /** Accessor to set the value of anchor and shape for one of the dimensions.
202  *
203  * @param[in] dimension Dimension for which the value is set.
204  * @param[in] start Value to be set in anchor for the dimension.
205  * @param[in] size Value to be set in shape for the dimension.
206  *
207  * @return *this.
208  */
209  ValidRegion &set(size_t dimension, int start, size_t size)
210  {
211  anchor.set(dimension, start);
212  shape.set(dimension, size);
213  return *this;
214  }
215 
216  /** Check whether two valid regions are equal.
217  *
218  * @param[in] lhs LHS valid region
219  * @param[in] rhs RHS valid region
220  *
221  * @return True if the valid regions are the same.
222  */
223  inline friend bool operator==(const ValidRegion &lhs, const ValidRegion &rhs);
224 
225  Coordinates anchor; /**< Anchor for the start of the valid region. */
226  TensorShape shape; /**< Shape of the valid region. */
227 };
228 inline bool operator==(const ValidRegion &lhs, const ValidRegion &rhs)
229 {
230  return (lhs.anchor == rhs.anchor) && (lhs.shape == rhs.shape);
231 }
232 
233 /** Methods available to handle borders */
234 enum class BorderMode
235 {
236  UNDEFINED, /**< Borders are left undefined */
237  CONSTANT, /**< Pixels outside the image are assumed to have a constant value */
238  REPLICATE /**< Pixels outside the image are assumed to have the same value as the closest image pixel */
239 };
240 
241 /** Container for 2D border size */
243 {
244  /** Empty border, i.e. no border */
245  constexpr BorderSize() noexcept
246  : top{ 0 },
247  right{ 0 },
248  bottom{ 0 },
249  left{ 0 }
250  {
251  }
252 
253  /** Border with equal size around the 2D plane */
254  explicit constexpr BorderSize(unsigned int size) noexcept
255  : top{ size },
256  right{ size },
257  bottom{ size },
258  left{ size }
259  {
260  }
261 
262  /** Border with same size for top/bottom and left/right */
263  constexpr BorderSize(unsigned int top_bottom, unsigned int left_right)
264  : top{ top_bottom }, right{ left_right }, bottom{ top_bottom }, left{ left_right }
265  {
266  }
267 
268  /** Border with different sizes */
269  constexpr BorderSize(unsigned int top, unsigned int right, unsigned int bottom, unsigned int left)
270  : top{ top }, right{ right }, bottom{ bottom }, left{ left }
271  {
272  }
273 
274  /** Check if the entire border is zero */
275  constexpr bool empty() const
276  {
277  return top == 0 && right == 0 && bottom == 0 && left == 0;
278  }
279 
280  /** Check if the border is the same size on all sides */
281  constexpr bool uniform() const
282  {
283  return top == right && top == bottom && top == left;
284  }
285 
286  /** Scale this border size.
287  *
288  * @param[in] scale Scale to multiply border size by.
289  *
290  * @return *this.
291  */
293  {
294  top *= scale;
295  right *= scale;
296  bottom *= scale;
297  left *= scale;
298 
299  return *this;
300  }
301 
302  /** Scale a copy of this border size.
303  *
304  * @param[in] scale Scale to multiply border size by.
305  *
306  * @return a scaled copy of this.
307  */
309  {
310  BorderSize size = *this;
311  size *= scale;
312 
313  return size;
314  }
315 
316  /** Check equality with another BorderSize struct
317  *
318  * @param[in] rhs other struct to check against
319  *
320  * @return true if they are equal
321  */
322  bool operator==(const BorderSize &rhs) const
323  {
324  return (top == rhs.top) && (right == rhs.right) && (bottom == rhs.bottom) && (left == rhs.left);
325  }
326 
327  /** Check non-equality with another BorderSize struct
328  *
329  * @param[in] rhs other struct to check against
330  *
331  * @return true if they are different
332  */
333  bool operator!=(const BorderSize &rhs) const
334  {
335  return !(*this == rhs);
336  }
337 
338  /** Limit this border size.
339  *
340  * @param[in] limit Border size to limit this border size to.
341  */
342  void limit(const BorderSize &limit)
343  {
344  top = std::min(top, limit.top);
345  right = std::min(right, limit.right);
346  bottom = std::min(bottom, limit.bottom);
347  left = std::min(left, limit.left);
348  }
349 
350  unsigned int top; /**< top of the border */
351  unsigned int right; /**< right of the border */
352  unsigned int bottom; /**< bottom of the border */
353  unsigned int left; /**< left of the border */
354 };
355 
356 /** Container for 2D padding size */
358 
359 /** Policy to handle integer overflow
360  * @note: This is ignored by floating point operations where the overflow behavior adheres to the IEEE-754 standard
361  * which states that in case of overflow ±infinity is returned for the round-to-nearest modes (and follows the
362  * rounding rules for the directed rounding modes) by default.
363  */
364 enum class ConvertPolicy
365 {
366  WRAP, /**< Wrap around */
367  SATURATE /**< Saturate */
368 };
369 
370 /** Interpolation method */
372 {
373  NEAREST_NEIGHBOR, /**< Output values are defined to match the source pixel whose center is nearest to the sample position */
374  BILINEAR, /**< Output values are defined by bilinear interpolation between the pixels */
375  AREA, /**< Output values are determined by averaging the source pixels whose areas fall under the area of the destination pixel, projected onto the source image */
376 };
377 
378 /** Bilinear Interpolation method used by LKTracker */
380 {
381  BILINEAR_OLD_NEW, /**< Old-new method */
382  BILINEAR_SCHARR /**< Scharr method */
383 };
384 
385 /** Rectangle type */
386 struct Rectangle
387 {
388  uint16_t x; /**< Top-left x coordinate */
389  uint16_t y; /**< Top-left y coordinate */
390  uint16_t width; /**< Width of the rectangle */
391  uint16_t height; /**< Height of the rectangle */
392 };
393 
394 /** Coordinate type */
396 {
397  int32_t x; /**< X coordinates */
398  int32_t y; /**< Y coordinates */
399 };
400 
401 /** Coordinate type */
403 {
404  uint32_t x; /**< X coordinates */
405  uint32_t y; /**< Y coordinates */
406  uint32_t z; /**< Z coordinates */
407 };
408 
409 /** Padding information as a pair of unsigned int start/end */
410 using PaddingInfo = std::pair<uint32_t, uint32_t>;
411 
412 /** List of padding information */
413 using PaddingList = std::vector<PaddingInfo>;
414 
415 /** Information to produce a tiled version of a Tensor */
416 using Multiples = std::vector<uint32_t>;
417 
418 /** Available reduction operations */
420 {
421  ARG_IDX_MAX, /**< Index of the max value */
422  ARG_IDX_MIN, /**< Index of the min value */
423  MEAN_SUM, /**< Mean of sum */
424  PROD, /**< Product */
425  SUM_SQUARE, /**< Sum of squares */
426  SUM, /**< Sum */
427  MIN, /**< Min */
428  MAX, /**< Max */
429 };
430 
431 /** Available element-wise operations */
433 {
434  ADD, /**< (x + y) */
435  SUB, /**< (x - y) */
436  DIV, /**< (x / y) */
437  MIN, /**< Min(x, y) */
438  MAX, /**< Max(x, y) */
439  SQUARED_DIFF, /**< (x - y)^2 */
440  POWER, /**< x ^ y */
441  PRELU, /**< y*x if x < 0, x otherwise */
442 };
443 
444 /** Available element wise unary operations */
446 {
447  RSQRT, /**< Reverse square root */
448  EXP, /**< Exponential */
449  NEG, /**< Negate */
450  LOG, /**< Natural Logarithm */
451  ABS, /**< Absolute value */
452  SIN, /**< Sine */
453  ROUND, /**< Round */
454  LOGICAL_NOT, /**< Logical Not */
455 };
456 
457 /** Available bitwise operations */
459 {
460  AND, /**< Bitwise AND operation */
461  NOT, /**< Bitwise NOT operation */
462  OR, /**< Bitwise OR operation */
463  XOR, /**< Bitwise XOR operation */
464 };
465 
466 /** The normalization type used for the normalization layer */
467 enum class NormType
468 {
469  IN_MAP_1D, /**< Normalization applied within the same map in 1D region */
470  IN_MAP_2D, /**< Normalization applied within the same map in 2D region */
471  CROSS_MAP /**< Normalization applied cross maps */
472 };
473 
474 /** Detection window used for the object detection. The detection window keeps the following information:
475  *
476  * -# Geometry of the rectangular window (x/y of top-left corner and width/height)
477  * -# Index of the class used for evaluating which class the detection window belongs to
478  * -# Confidence value (score) obtained with the classifier
479  */
481 {
482  uint16_t x{ 0 }; /**< Top-left x coordinate */
483  uint16_t y{ 0 }; /**< Top-left y coordinate */
484  uint16_t width{ 0 }; /**< Width of the detection window */
485  uint16_t height{ 0 }; /**< Height of the detection window */
486  uint16_t idx_class{ 0 }; /**< Index of the class */
487  float score{ 0.f }; /**< Confidence value for the detection window */
488 };
489 
490 /** Available pooling types */
491 enum class PoolingType
492 {
493  MAX, /**< Max Pooling */
494  AVG, /**< Average Pooling */
495  L2 /**< L2 Pooling */
496 };
497 
498 /** Available non maxima suppression types */
499 enum class NMSType
500 {
501  LINEAR, /**< Linear NMS */
502  GAUSSIAN, /**< Gaussian NMS */
503  ORIGINAL /**< Original NMS */
504 };
505 
506 /** BoxWithNonMaximaSuppressionLimit Information class */
507 class BoxNMSLimitInfo final
508 {
509 public:
510  /** Constructor
511  *
512  * @param[in] score_thresh (Optional) Score threshold.
513  * @param[in] nms (Optional) NMS value
514  * @param[in] detections (Optional) Number of detections
515  * @param[in] soft_nms_enabled (Optional) Enable SoftNMS
516  * @param[in] soft_nms_method (Optional) Soft NMS method
517  * @param[in] soft_nms_sigma (Optional) Soft NMS sigma value
518  * @param[in] soft_nms_min_score_thres (Optional) Soft NMS minimum score threshold
519  * @param[in] suppress_size (Optional) Filter out boxes based on their size. Defaults to false
520  * @param[in] min_size (Optional) Smaller boxes than min_size will be filtered out. Defaults to 1
521  * @param[in] im_width (Optional) Boxes whose centers (on the x axis) is beyond im_width will be filtered. Defaults to 1
522  * @param[in] im_height (Optional) Boxes whose centers (on the y axis) is beyond im_height will be filtered. Defaults to 1
523  */
524  BoxNMSLimitInfo(float score_thresh = 0.05f, float nms = 0.3f,
525  int detections = 100, bool soft_nms_enabled = false,
527  float soft_nms_sigma = 0.5f, float soft_nms_min_score_thres = 0.001f, bool suppress_size = false, float min_size = 1.0f, float im_width = 1.0f, float im_height = 1.0f)
528  : _score_thresh(score_thresh), _nms(nms), _detections_per_im(detections), _soft_nms_enabled(soft_nms_enabled), _soft_nms_method(soft_nms_method), _soft_nms_sigma(soft_nms_sigma),
529  _soft_nms_min_score_thres(soft_nms_min_score_thres), _suppress_size(suppress_size), _min_size(min_size), _im_width(im_width), _im_height(im_height)
530  {
531  }
532  /** Get the score threshold */
533  float score_thresh() const
534  {
535  return _score_thresh;
536  }
537  /** Get the NMS */
538  float nms() const
539  {
540  return _nms;
541  }
542  /** Get the number of detections */
543  int detections_per_im() const
544  {
545  return _detections_per_im;
546  }
547  /** Check if soft NMS is enabled */
548  bool soft_nms_enabled() const
549  {
550  return _soft_nms_enabled;
551  }
552  /** Get soft NMS method */
554  {
555  return _soft_nms_method;
556  }
557  /** Get soft NMS sigma */
558  float soft_nms_sigma() const
559  {
560  return _soft_nms_sigma;
561  }
562  /** Get soft nms min score threshold */
564  {
565  return _soft_nms_min_score_thres;
566  }
567  /** Get if NMS will suppress boxes based on their size/position */
568  bool suppress_size() const
569  {
570  return _suppress_size;
571  }
572  /** Get size suppression threshold */
573  float min_size() const
574  {
575  return _min_size;
576  }
577  /** Get image width (NMS may suppress boxes whose center sits beyond the image width) */
578  float im_width() const
579  {
580  return _im_width;
581  }
582  /** Get image height (NMS may suppress boxes whose center sits beyond the image height) */
583  float im_height() const
584  {
585  return _im_height;
586  }
587 
588 private:
589  float _score_thresh;
590  float _nms;
591  int _detections_per_im;
592  bool _soft_nms_enabled;
593  NMSType _soft_nms_method;
594  float _soft_nms_sigma;
595  float _soft_nms_min_score_thres;
596  bool _suppress_size;
597  float _min_size;
598  float _im_width;
599  float _im_height;
600 };
601 
602 /** Padding and stride information class */
603 /** Padding information for 2D operations like Conv2d */
604 struct Padding2D
605 {
606  Padding2D() = default;
607  Padding2D(size_t left, size_t right, size_t top, size_t bottom)
609  {
610  }
611  size_t left = { 0 }; /**< Padding across the width dimension on the left, in elements. */
612  size_t right = { 0 }; /**< Padding across the width dimension on the right, in elements. */
613  size_t top = { 0 }; /**< Padding across the height dimension on the top, in elements. */
614  size_t bottom = { 0 }; /**< Padding across the height dimension on the bottom, in elements. */
615 };
616 
617 /** Padding information for 3D operations like Conv3d */
618 struct Padding3D
619 {
620  Padding3D() noexcept
621  {
622  }
623 
624  Padding3D(size_t pad_x, size_t pad_y, size_t pad_z)
625  : left(pad_x), right(pad_x), top(pad_y), bottom(pad_y), front(pad_z), back(pad_z)
626  {
627  }
628 
629  Padding3D(size_t left, size_t right, size_t top, size_t bottom, size_t front, size_t back)
631  {
632  }
633 
634  size_t left = { 0 }; /**< Padding across the width dimenstion on the left, in elements. */
635  size_t right = { 0 }; /**< Padding across the width dimenstion on the right, in elements. */
636  size_t top = { 0 }; /**< Padding across the height dimenstion on the top, in elements. */
637  size_t bottom = { 0 }; /**< Padding across the height dimenstion on the bottom, in elements. */
638  size_t front = { 0 }; /**< Padding across the depth dimenstion on the front, in elements. */
639  size_t back = { 0 }; /**< Padding across the depth dimenstion on the back, in elements. */
640 };
641 
642 /** PriorBox layer info */
643 class PriorBoxLayerInfo final
644 {
645 public:
646  /** Default Constructor */
648  : _min_sizes(),
649  _variances(),
650  _offset(),
651  _flip(true),
652  _clip(false),
653  _max_sizes(),
654  _aspect_ratios(),
655  _img_size(),
656  _steps()
657  {
658  }
659  /** Constructor
660  *
661  * @param[in] min_sizes Min sizes vector.
662  * @param[in] variances Variances vector.
663  * @param[in] offset Offset value.
664  * @param[in] flip (Optional) Flip the aspect ratios.
665  * @param[in] clip (Optional) Clip coordinates so that they're within [0,1].
666  * @param[in] max_sizes (Optional) Max sizes vector.
667  * @param[in] aspect_ratios (Optional) Aspect ratios of the boxes.
668  * @param[in] img_size (Optional) Image size.
669  * @param[in] steps (Optional) Step values.
670  */
671  PriorBoxLayerInfo(const std::vector<float> &min_sizes, const std::vector<float> &variances, float offset, bool flip = true, bool clip = false,
672  const std::vector<float> &max_sizes = {}, const std::vector<float> &aspect_ratios = {},
673  const Coordinates2D &img_size = Coordinates2D{ 0, 0 }, const std::array<float, 2> &steps = { { 0.f, 0.f } })
674  : _min_sizes(min_sizes),
675  _variances(variances),
676  _offset(offset),
677  _flip(flip),
678  _clip(clip),
679  _max_sizes(max_sizes),
680  _aspect_ratios(),
681  _img_size(img_size),
682  _steps(steps)
683  {
684  _aspect_ratios.push_back(1.);
685  for(unsigned int i = 0; i < aspect_ratios.size(); ++i)
686  {
687  float ar = aspect_ratios[i];
688  bool already_exist = false;
689  for(auto ar_new : _aspect_ratios)
690  {
691  if(fabs(ar - ar_new) < 1e-6)
692  {
693  already_exist = true;
694  break;
695  }
696  }
697  if(!already_exist)
698  {
699  _aspect_ratios.push_back(ar);
700  if(flip)
701  {
702  _aspect_ratios.push_back(1.f / ar);
703  }
704  }
705  }
706  }
707  /** Get min sizes. */
708  std::vector<float> min_sizes() const
709  {
710  return _min_sizes;
711  }
712  /** Get min variances. */
713  std::vector<float> variances() const
714  {
715  return _variances;
716  }
717  /** Get the step coordinates */
718  std::array<float, 2> steps() const
719  {
720  return _steps;
721  }
722  /** Get the image size coordinates */
724  {
725  return _img_size;
726  }
727  /** Get the offset */
728  float offset() const
729  {
730  return _offset;
731  }
732  /** Get the flip value */
733  bool flip() const
734  {
735  return _flip;
736  }
737  /** Get the clip value */
738  bool clip() const
739  {
740  return _clip;
741  }
742  /** Get max sizes. */
743  std::vector<float> max_sizes() const
744  {
745  return _max_sizes;
746  }
747  /** Get aspect ratios. */
748  std::vector<float> aspect_ratios() const
749  {
750  return _aspect_ratios;
751  }
752 
753 private:
754  std::vector<float> _min_sizes;
755  std::vector<float> _variances;
756  float _offset;
757  bool _flip;
758  bool _clip;
759  std::vector<float> _max_sizes;
760  std::vector<float> _aspect_ratios;
761  Coordinates2D _img_size;
762  std::array<float, 2> _steps;
763 };
764 
765 // Bounding Box [xmin, ymin, xmax, ymax]
766 using BBox = std::array<float, 4>;
767 // LabelBBox used for map label and bounding box
768 using LabelBBox = std::map<int, std::vector<BBox>>;
769 
770 /** Available Detection Output code types */
772 {
773  CORNER, /**< Use box corners */
774  CENTER_SIZE, /**< Use box centers and size */
775  CORNER_SIZE, /**< Use box centers and size */
776  TF_CENTER /**< Use box centers and size but flip x and y co-ordinates */
777 };
778 
779 /** Detection Output layer info */
781 {
782 public:
783  /** Default Constructor */
785  : _num_classes(),
786  _share_location(),
788  _keep_top_k(),
789  _nms_threshold(),
790  _top_k(),
791  _background_label_id(),
792  _confidence_threshold(),
793  _variance_encoded_in_target(false),
794  _eta(),
795  _num_loc_classes()
796  {
797  _num_loc_classes = _share_location ? 1 : _num_classes;
798  }
799  /** Constructor
800  *
801  * @param[in] num_classes Number of classes to be predicted.
802  * @param[in] share_location If true, bounding box are shared among different classes.
803  * @param[in] code_type Type of coding method for bbox.
804  * @param[in] keep_top_k Number of total bounding boxes to be kept per image after NMS step.
805  * @param[in] nms_threshold Threshold to be used in NMS.
806  * @param[in] top_k (Optional) Number of boxes per image with top confidence scores that are fed into the NMS algorithm. Default set to -1.
807  * @param[in] background_label_id (Optional) Background label ID. If there is no background class, set it as -1.
808  * @param[in] confidence_threshold (Optional) Only consider detections whose confidences are larger than a threshold. Default set to -FLT_MAX.
809  * @param[in] variance_encoded_in_target (Optional) If true, variance is encoded in target. Otherwise we need to adjust the predicted offset accordingly.Default set to false.
810  * @param[in] eta (Optional) Eta.
811  */
814  : _num_classes(num_classes),
815  _share_location(share_location),
816  _code_type(code_type),
817  _keep_top_k(keep_top_k),
818  _nms_threshold(nms_threshold),
819  _top_k(top_k),
820  _background_label_id(background_label_id),
821  _confidence_threshold(confidence_threshold),
822  _variance_encoded_in_target(variance_encoded_in_target),
823  _eta(eta),
824  _num_loc_classes()
825  {
826  _num_loc_classes = _share_location ? 1 : _num_classes;
827  }
828  /** Get num classes. */
829  int num_classes() const
830  {
831  return _num_classes;
832  }
833  /** Get share location. */
834  bool share_location() const
835  {
836  return _share_location;
837  }
838  /** Get detection output code type. */
840  {
841  return _code_type;
842  }
843  /** Get if variance encoded in target. */
845  {
846  return _variance_encoded_in_target;
847  }
848  /** Get the number of total bounding boxes to be kept per image. */
849  int keep_top_k() const
850  {
851  return _keep_top_k;
852  }
853  /** Get nms threshold. */
854  float nms_threshold() const
855  {
856  return _nms_threshold;
857  }
858  /** Get eta. */
859  float eta() const
860  {
861  return _eta;
862  }
863  /** Get background label ID. */
865  {
866  return _background_label_id;
867  }
868  /** Get confidence threshold. */
869  float confidence_threshold() const
870  {
871  return _confidence_threshold;
872  }
873  /** Get top K. */
874  int top_k() const
875  {
876  return _top_k;
877  }
878  /** Get number of location classes. */
879  int num_loc_classes() const
880  {
881  return _num_loc_classes;
882  }
883 
884 private:
885  int _num_classes;
886  bool _share_location;
887  DetectionOutputLayerCodeType _code_type;
888  int _keep_top_k;
889  float _nms_threshold;
890  int _top_k;
891  int _background_label_id;
892  float _confidence_threshold;
893  bool _variance_encoded_in_target;
894  float _eta;
895  int _num_loc_classes;
896 };
897 
898 /** Detection Output layer info */
900 {
901 public:
902  /** Default Constructor */
904  : _max_detections(),
905  _max_classes_per_detection(),
906  _nms_score_threshold(),
907  _iou_threshold(),
908  _num_classes(),
909  _scales_values(),
910  _use_regular_nms(),
911  _detection_per_class(),
912  _dequantize_scores()
913  {
914  }
915  /** Constructor
916  *
917  * @param[in] max_detections Number of total detection.
918  * @param[in] max_classes_per_detection Number of total classes to be kept after NMS step. Used in the Fast Non-Max-Suppression
919  * @param[in] nms_score_threshold Threshold to be used in NMS
920  * @param[in] iou_threshold Threshold to be used during the intersection over union.
921  * @param[in] num_classes Number of classes.
922  * @param[in] scales_values Scales values used for decode center size boxes.
923  * @param[in] use_regular_nms (Optional) Boolean to determinate if use regular or fast nms. Defaults to false.
924  * @param[in] detection_per_class (Optional) Number of detection per class. Used in the Regular Non-Max-Suppression. Defaults to 100.
925  * @param[in] dequantize_scores (Optional) If the scores need to be dequantized. Defaults to true.
926  */
928  std::array<float, 4> scales_values, bool use_regular_nms = false, unsigned int detection_per_class = 100, bool dequantize_scores = true)
929  : _max_detections(max_detections),
930  _max_classes_per_detection(max_classes_per_detection),
931  _nms_score_threshold(nms_score_threshold),
932  _iou_threshold(iou_threshold),
933  _num_classes(num_classes),
934  _scales_values(scales_values),
935  _use_regular_nms(use_regular_nms),
936  _detection_per_class(detection_per_class),
937  _dequantize_scores(dequantize_scores)
938  {
939  }
940  /** Get max detections. */
941  unsigned int max_detections() const
942  {
943  return _max_detections;
944  }
945  /** Get max_classes per detection. Used in the Fast Non-Max-Suppression.*/
946  unsigned int max_classes_per_detection() const
947  {
948  return _max_classes_per_detection;
949  }
950  /** Get detection per class. Used in the Regular Non-Max-Suppression */
951  unsigned int detection_per_class() const
952  {
953  return _detection_per_class;
954  }
955  /** Get nms threshold. */
956  float nms_score_threshold() const
957  {
958  return _nms_score_threshold;
959  }
960  /** Get intersection over union threshold. */
961  float iou_threshold() const
962  {
963  return _iou_threshold;
964  }
965  /** Get num classes. */
966  unsigned int num_classes() const
967  {
968  return _num_classes;
969  }
970  /** Get if use regular nms. */
971  bool use_regular_nms() const
972  {
973  return _use_regular_nms;
974  }
975  /** Get y scale value. */
976  float scale_value_y() const
977  {
978  // Saved as [y,x,h,w]
979  return _scales_values[0];
980  }
981  /** Get x scale value. */
982  float scale_value_x() const
983  {
984  // Saved as [y,x,h,w]
985  return _scales_values[1];
986  }
987  /** Get h scale value. */
988  float scale_value_h() const
989  {
990  // Saved as [y,x,h,w]
991  return _scales_values[2];
992  }
993  /** Get w scale value. */
994  float scale_value_w() const
995  {
996  // Saved as [y,x,h,w]
997  return _scales_values[3];
998  }
999  /** Get dequantize_scores value. */
1000  bool dequantize_scores() const
1001  {
1002  return _dequantize_scores;
1003  }
1004 
1005 private:
1006  unsigned int _max_detections;
1007  unsigned int _max_classes_per_detection;
1008  float _nms_score_threshold;
1009  float _iou_threshold;
1010  unsigned int _num_classes;
1011  std::array<float, 4> _scales_values;
1012  bool _use_regular_nms;
1013  unsigned int _detection_per_class;
1014  bool _dequantize_scores;
1015 };
1016 
1017 /** Pooling Layer Information struct*/
1019 {
1020  /** Default Constructor */
1023  pool_size(Size2D()),
1026  exclude_padding(false),
1027  is_global_pooling(false),
1028  fp_mixed_precision(false),
1029  use_inf_as_limit(true),
1030  use_kernel_indices(false)
1031  {
1032  }
1033  /** Constructor
1034  *
1035  * @param[in] pool_type Pooling type @ref PoolingType.
1036  * @param[in] pool_size Pooling size, in elements, across x and y.
1037  * @param[in] data_layout Data layout used by the layer @ref DataLayout
1038  * @param[in] pad_stride_info (Optional) Padding and stride information @ref PadStrideInfo
1039  * @param[in] exclude_padding (Optional) Strategy when accounting padding in calculations.
1040  * True will exclude padding while false will not (Used in AVG/L2 pooling to determine the pooling area).
1041  * Defaults to false;
1042  * @param[in] fp_mixed_precision (Optional) Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy.
1043  * @param[in] use_inf_as_limit (Optional) Use inf to represent the limits of datatypes range, instead of using "lowest" property of the data type.
1044  * @param[in] use_kernel_indices (Optional) Use kernel indices instead of using source indices while computing indices tensor.
1045  */
1047  unsigned int pool_size,
1050  bool exclude_padding = false,
1051  bool fp_mixed_precision = false,
1052  bool use_inf_as_limit = true,
1053  bool use_kernel_indices = false)
1054  : pool_type(pool_type),
1059  is_global_pooling(false),
1063  {
1064  }
1065 
1066  /** Constructor
1067  *
1068  * @param[in] pool_type Pooling type @ref PoolingType.
1069  * @param[in] pool_size Pooling size, in elements, across x and y.
1070  * @param[in] data_layout Data layout used by the layer @ref DataLayout
1071  * @param[in] pad_stride_info (Optional) Padding and stride information @ref PadStrideInfo
1072  * @param[in] exclude_padding (Optional) Strategy when accounting padding in calculations.
1073  * True will exclude padding while false will not (Used in AVG/L2 pooling to determine the pooling area).
1074  * Defaults to false;
1075  * @param[in] fp_mixed_precision (Optional) Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy.
1076  * @param[in] use_inf_as_limit (Optional) Use inf to represent the limits of datatypes range, instead of using "lowest" property of the data type.
1077  * @param[in] use_kernel_indices (Optional) Use kernel indices instead of using source indices while computing indices tensor.
1078  */
1080  Size2D pool_size,
1083  bool exclude_padding = false,
1084  bool fp_mixed_precision = false,
1085  bool use_inf_as_limit = true,
1086  bool use_kernel_indices = false)
1087  : pool_type(pool_type),
1092  is_global_pooling(false),
1096  {
1097  }
1098 
1099  /** Constructor
1100  *
1101  * @note This constructor is used for global pooling
1102  *
1103  * @param[in] pool_type Pooling type @ref PoolingType.
1104  * @param[in] data_layout Data layout used by the layer @ref DataLayout
1105  */
1107  : pool_type(pool_type),
1108  pool_size(Size2D()),
1110  pad_stride_info(PadStrideInfo(1, 1, 0, 0)),
1111  exclude_padding(false),
1112  is_global_pooling(true),
1113  fp_mixed_precision(false),
1114  use_inf_as_limit(true),
1115  use_kernel_indices(false)
1116  {
1117  }
1118 
1128 };
1129 
1130 /** Pooling Layer Information struct*/
1132 {
1133  /** Default Constructor */
1135  : pool_type(PoolingType::MAX),
1136  pool_size(Size3D()),
1137  stride(Size3D()),
1138  padding(Padding3D()),
1139  exclude_padding(false),
1140  is_global_pooling(false),
1141  fp_mixed_precision(false),
1143  {
1144  }
1145  /** Constructor
1146  *
1147  * @param[in] pool_type Pooling type @ref PoolingType.
1148  * @param[in] pool_size Pooling size, in elements, across x, y and z.
1149  * @param[in] stride (Optional) stride information @ref Size3D
1150  * @param[in] padding (Optional) padding information @ref Padding3D
1151  * @param[in] exclude_padding (Optional) Strategy when accounting padding in calculations.
1152  * True will exclude padding while false will not (Used in AVG/L2 pooling to determine the pooling area).
1153  * Defaults to false;
1154  * @param[in] fp_mixed_precision (Optional) Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy.
1155  * @param[in] round_type (Optional) Dimensions rounding. Defaults to @ref DimensionRoundingType::FLOOR
1156  */
1158  unsigned int pool_size,
1159  Size3D stride = Size3D(1U, 1U, 1U),
1161  bool exclude_padding = false,
1162  bool fp_mixed_precision = false,
1164  : pool_type(pool_type),
1166  stride(stride),
1167  padding(padding),
1169  is_global_pooling(false),
1172  {
1173  }
1174 
1175  /** Constructor
1176  *
1177  * @param[in] pool_type Pooling type @ref PoolingType.
1178  * @param[in] pool_size Pooling size, in elements, across x, y and z.
1179  * @param[in] stride (Optional) stride information @ref Size3D
1180  * @param[in] padding (Optional) padding information @ref Padding3D
1181  * @param[in] exclude_padding (Optional) Strategy when accounting padding in calculations.
1182  * True will exclude padding while false will not (Used in AVG/L2 pooling to determine the pooling area).
1183  * Defaults to false;
1184  * @param[in] fp_mixed_precision (Optional) Use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy.
1185  * @param[in] round_type (Optional) Dimensions rounding. Defaults to @ref DimensionRoundingType::FLOOR
1186  */
1188  Size3D pool_size,
1189  Size3D stride = Size3D(1U, 1U, 1U),
1191  bool exclude_padding = false,
1192  bool fp_mixed_precision = false,
1194  : pool_type(pool_type),
1196  stride(stride),
1197  padding(padding),
1199  is_global_pooling(false),
1202  {
1203  }
1204 
1205  /** Constructor
1206  *
1207  * @note This constructor is used for global pooling
1208  *
1209  * @param[in] pool_type Pooling type @ref PoolingType.
1210  */
1212  : pool_type(pool_type),
1213  pool_size(Size3D()),
1214  stride(Size3D(1U, 1U, 1U)),
1215  padding(Padding3D(0, 0, 0)),
1216  exclude_padding(false),
1217  is_global_pooling(true),
1218  fp_mixed_precision(false),
1220  {
1221  }
1222 
1231 };
1232 
1233 /** ROI Pooling Layer Information class */
1235 {
1236 public:
1237  /** Constructor
1238  *
1239  * @param[in] pooled_width Pooled width of the layer.
1240  * @param[in] pooled_height Pooled height of the layer.
1241  * @param[in] spatial_scale Spatial scale to be applied to the ROI coordinates and dimensions.
1242  * @param[in] sampling_ratio Number of samples to include in each pooling region (if set to zero, a ceil(roi_dims/pooling_dims))
1243  */
1244  ROIPoolingLayerInfo(unsigned int pooled_width, unsigned int pooled_height, float spatial_scale, unsigned int sampling_ratio = 0)
1245  : _pooled_width(pooled_width), _pooled_height(pooled_height), _spatial_scale(spatial_scale), _sampling_ratio(sampling_ratio)
1246  {
1247  }
1248  /** Get the pooled width of the layer */
1249  unsigned int pooled_width() const
1250  {
1251  return _pooled_width;
1252  }
1253  /** Get the pooled height of the layer */
1254  unsigned int pooled_height() const
1255  {
1256  return _pooled_height;
1257  }
1258  /** Get the spatial scale */
1259  float spatial_scale() const
1260  {
1261  return _spatial_scale;
1262  }
1263  /** Get sampling ratio */
1264  unsigned int sampling_ratio() const
1265  {
1266  return _sampling_ratio;
1267  }
1268 
1269 private:
1270  unsigned int _pooled_width;
1271  unsigned int _pooled_height;
1272  float _spatial_scale;
1273  unsigned int _sampling_ratio;
1274 };
1275 
1276 /** Generate Proposals Information class */
1278 {
1279 public:
1280  /** Constructor
1281  *
1282  * @param[in] im_width Width of the original image
1283  * @param[in] im_height Height of the original image
1284  * @param[in] im_scale Scale applied to the original image
1285  * @param[in] spatial_scale (Optional)Scale applied to the feature map. Defaults to 1.0
1286  * @param[in] pre_nms_topN (Optional)Number of the best scores to be selected from the transformations. Defaults to 6000.
1287  * @param[in] post_nms_topN (Optional)Number of the best scores to be selected from the NMS operation. Defaults to 300.
1288  * @param[in] nms_thres (Optional)NMS overlap threshold. Defaults to 0.7.
1289  * @param[in] min_size (Optional)Size used to validate the anchors produced. Defaults to 16.
1290  * @param[in] values_per_roi (Optional)Values used to represent a ROI(Region of interest). Defaults to 4.
1291  */
1292  GenerateProposalsInfo(float im_width, float im_height, float im_scale, float spatial_scale = 1.0, int pre_nms_topN = 6000, int post_nms_topN = 300, float nms_thres = 0.7, float min_size = 16.0,
1293  size_t values_per_roi = 4)
1294  : _im_height(im_height), _im_width(im_width), _im_scale(im_scale), _spatial_scale(spatial_scale), _pre_nms_topN(pre_nms_topN), _post_nms_topN(post_nms_topN), _nms_thres(nms_thres),
1295  _min_size(min_size), _values_per_roi(values_per_roi)
1296  {
1297  }
1298 
1299  /* Get the original height */
1300  float im_height() const
1301  {
1302  return _im_height;
1303  }
1304  /* Get the original width */
1305  float im_width() const
1306  {
1307  return _im_width;
1308  }
1309  /* Get the image scale */
1310  float im_scale() const
1311  {
1312  return _im_scale;
1313  }
1314  /* Get the value of how many best scores to select (before NMS) */
1315  int pre_nms_topN() const
1316  {
1317  return _pre_nms_topN;
1318  }
1319  /* Get the value of how many best scores to select (after NMS) */
1320  int post_nms_topN() const
1321  {
1322  return _post_nms_topN;
1323  }
1324  /* Get the NMS overlap threshold */
1325  float nms_thres() const
1326  {
1327  return _nms_thres;
1328  }
1329  /* Get the minimal size */
1330  float min_size() const
1331  {
1332  return _min_size;
1333  }
1334  /* Get the spatial scale to be applied to the feature maps */
1335  float spatial_scale() const
1336  {
1337  return _spatial_scale;
1338  }
1339  /* Get the values used to represent a ROI(Region of interest)*/
1340  size_t values_per_roi() const
1341  {
1342  return _values_per_roi;
1343  }
1344 
1345 private:
1346  float _im_height;
1347  float _im_width;
1348  float _im_scale;
1349  float _spatial_scale;
1350  int _pre_nms_topN;
1351  int _post_nms_topN;
1352  float _nms_thres;
1353  float _min_size;
1354  size_t _values_per_roi;
1355 };
1356 
1357 /** ComputeAnchors information class */
1359 {
1360 public:
1361  /** Constructor
1362  *
1363  * @param[in] feat_width Feature map width
1364  * @param[in] feat_height Feature map height
1365  * @param[in] spatial_scale Feature map scale
1366  * @param[in] values_per_roi (Optional)Values used to represent a ROI(Region Of Interest). Defaults to 4
1367  */
1369  : _feat_height(feat_height),
1370  _feat_width(feat_width),
1371  _spatial_scale(spatial_scale),
1372  _values_per_roi(values_per_roi)
1373  {
1374  }
1375 
1376  /* Get the height of the feature map */
1377  float feat_height() const
1378  {
1379  return _feat_height;
1380  }
1381 
1382  /* Get the width of the feature map */
1383  float feat_width() const
1384  {
1385  return _feat_width;
1386  }
1387 
1388  /* Get the scale of the feature map */
1389  float spatial_scale() const
1390  {
1391  return _spatial_scale;
1392  }
1393 
1394  /* Get the values used to represent a ROI(Region Of Interest)*/
1395  size_t values_per_roi() const
1396  {
1397  return _values_per_roi;
1398  }
1399 
1400 private:
1401  float _feat_height;
1402  float _feat_width;
1403  float _spatial_scale;
1404  size_t _values_per_roi;
1405 };
1406 
1407 /** Bounding Box Transform information class */
1409 {
1410 public:
1411  /** Constructor
1412  *
1413  * @param[in] img_width Width of the original image
1414  * @param[in] img_height Height, of the original image
1415  * @param[in] scale Scale of the original image
1416  * @param[in] apply_scale (Optional)Re-apply scaling after transforming the boxes. Defaults to false
1417  * @param[in] weights (Optional)Weights [wx, wy, ww, wh] for the deltas. Defaults to all ones
1418  * @param[in] correct_transform_coords (Optional)Correct bounding box transform coordinates. Defaults to false
1419  * @param[in] bbox_xform_clip (Optional)Minimum bounding box width and height after bounding box transformation in log-space. Defaults to log(1000/16)
1420  */
1421  BoundingBoxTransformInfo(float img_width, float img_height, float scale, bool apply_scale = false, const std::array<float, 4> weights = { { 1.f, 1.f, 1.f, 1.f } }, bool correct_transform_coords =
1422  false,
1423  float bbox_xform_clip =
1424  4.135166556742356f)
1425  : _img_width(img_width), _img_height(img_height), _scale(scale), _apply_scale(apply_scale), _correct_transform_coords(correct_transform_coords), _weights(weights), _bbox_xform_clip(bbox_xform_clip)
1426  {
1427  }
1428 
1429  std::array<float, 4> weights() const
1430  {
1431  return _weights;
1432  }
1433 
1434  float bbox_xform_clip() const
1435  {
1436  return _bbox_xform_clip;
1437  }
1438 
1439  float img_height() const
1440  {
1441  return _img_height;
1442  }
1443 
1444  float img_width() const
1445  {
1446  return _img_width;
1447  }
1448 
1449  float scale() const
1450  {
1451  return _scale;
1452  }
1453 
1454  bool apply_scale() const
1455  {
1456  return _apply_scale;
1457  }
1458 
1460  {
1461  return _correct_transform_coords;
1462  }
1463 
1464 private:
1465  float _img_width;
1466  float _img_height;
1467  float _scale;
1468  bool _apply_scale;
1469  bool _correct_transform_coords;
1470  std::array<float, 4> _weights;
1471  float _bbox_xform_clip;
1472 };
1473 
1474 /** Normalization Layer Information class */
1476 {
1477 public:
1478  /** Default Constructor
1479  *
1480  * @param[in] type The normalization type. Can be @ref NormType::IN_MAP_1D, @ref NormType::IN_MAP_2D or @ref NormType::CROSS_MAP
1481  * @param[in] norm_size The normalization size is the number of elements to normalize across. Defaults to 5.
1482  * @param[in] alpha (Optional) Alpha parameter used by normalization equation. Defaults to 0.0001.
1483  * @param[in] beta (Optional) Beta parameter used by normalization equation. Defaults to 0.5.
1484  * @param[in] kappa (Optional) Kappa parameter used by [Krichevksy 2012] Across Channel Local Brightness Normalization equation.
1485  * @param[in] is_scaled (Optional) Boolean that specifies if alpha will be scaled by the normalization size or not.
1486  * Should be false to follow [Krichevksy 2012].
1487  */
1488  NormalizationLayerInfo(NormType type, uint32_t norm_size = 5, float alpha = 0.0001f, float beta = 0.5f, float kappa = 1.f, bool is_scaled = true)
1489  : _type(type), _norm_size(norm_size), _alpha(alpha), _beta(beta), _kappa(kappa), _is_scaled(is_scaled)
1490  {
1491  }
1492  /** Get the normalization type */
1493  NormType type() const
1494  {
1495  return _type;
1496  }
1497  /** Get the normalization size */
1498  uint32_t norm_size() const
1499  {
1500  return _norm_size;
1501  }
1502  /** Get the alpha value */
1503  float alpha() const
1504  {
1505  return _alpha;
1506  }
1507  /** Get the beta value */
1508  float beta() const
1509  {
1510  return _beta;
1511  }
1512  /** Get the kappa value */
1513  float kappa() const
1514  {
1515  return _kappa;
1516  }
1517  /** Get the is_scaled value */
1518  bool is_scaled() const
1519  {
1520  return _is_scaled;
1521  }
1522  /** Check if normalization is cross map */
1523  bool is_cross_map() const
1524  {
1525  return _type == NormType::CROSS_MAP;
1526  }
1527  /** Check if normalization is not cross map */
1528  bool is_in_map() const
1529  {
1530  return !is_cross_map();
1531  }
1532  /** Return the scaling factor of the normalization function.
1533  *
1534  * If is_scaled is set to false then [Krichevksy 2012] normalization scaling is performed,
1535  * where alpha is returned plainly, else alpha is scaled by the total number of elements used for the normalization.
1536  *
1537  * @return The normalization scaling factor.
1538  */
1539  float scale_coeff() const
1540  {
1541  const uint32_t size = (_type == NormType::IN_MAP_2D) ? _norm_size * _norm_size : _norm_size;
1542  return (_is_scaled) ? (_alpha / size) : _alpha;
1543  }
1544 
1545 private:
1546  NormType _type;
1547  uint32_t _norm_size;
1548  float _alpha;
1549  float _beta;
1550  float _kappa;
1551  bool _is_scaled;
1552 };
1553 
1555 {
1556 public:
1557  /** Default Constructor
1558  *
1559  * @param[in] begin_mask (Optional) If the ith bit of begin_mask is set, starts[i] is ignored and the fullest possible range in that dimension is used instead.
1560  * @param[in] end_mask (Optional) If the ith bit of end_mask is set, ends[i] is ignored and the fullest possible range in that dimension is used instead.
1561  * @param[in] shrink_axis_mask (Optional) If the ith bit of shrink_axis_mask is set, it implies that the ith specification shrinks the dimensionality by 1.
1562  */
1563  StridedSliceLayerInfo(int32_t begin_mask = 0, int32_t end_mask = 0, int32_t shrink_axis_mask = 0)
1564  : _begin_mask(begin_mask), _end_mask(end_mask), _shrink_axis_mask(shrink_axis_mask)
1565  {
1566  }
1567 
1568  /* Get the begin mask value */
1569  int32_t begin_mask() const
1570  {
1571  return _begin_mask;
1572  }
1573 
1574  /* Get the end mask value */
1575  int32_t end_mask() const
1576  {
1577  return _end_mask;
1578  }
1579 
1580  /* Get the shrink axis mask value */
1581  int32_t shrink_axis_mask() const
1582  {
1583  return _shrink_axis_mask;
1584  }
1585 
1586 private:
1587  int32_t _begin_mask;
1588  int32_t _end_mask;
1589  int32_t _shrink_axis_mask;
1590 };
1591 
1592 // OHWIo<interleave_by>i<block_by>
1593 inline int interleave_by(const WeightFormat wf)
1594 {
1595  return (static_cast<int>(wf) >> 8) & 0xFFF;
1596 }
1597 inline int block_by(const WeightFormat wf)
1598 {
1599  return (static_cast<int>(wf) >> 20) & 0xF;
1600 }
1601 inline bool is_fixed_format(const WeightFormat &wf)
1602 {
1603  return wf != WeightFormat::UNSPECIFIED && wf != WeightFormat::ANY;
1604 }
1606 {
1607  return (static_cast<int>(wf) >> 4) & 0x1;
1608 }
1609 
1610 /** Convolution Layer Weights Information class. This class stores the necessary information to compute convolution layer when the weights are already reshaped */
1612 {
1613 public:
1614  /** Default constructor */
1616  : _are_reshaped(false), _kernel_width(0), _kernel_height(0), _num_kernels(0), _retain_internal_weights(false), _weight_format(arm_compute::WeightFormat::UNSPECIFIED)
1617  {
1618  }
1619  /** Constructor
1620  *
1621  * @param[in] are_reshaped True if the weights have been reshaped
1622  * @param[in] kernel_width Kernel width.
1623  * @param[in] kernel_height Kernel height.
1624  * @param[in] num_kernels Number of convolution kernels.
1625  * @param[in] retain_internal_weights (Optional) True if internal reshaped weights must be retained. Used for reconfiguration purposes. Default is false.
1626  * @param[in] weight_format (Optional) arm_gemm:WeightFormat enumeration requested by the user. Default is arm_compute::WeightFormat::UNSPECIFIED.
1627  */
1628  WeightsInfo(bool are_reshaped, unsigned int kernel_width, unsigned int kernel_height, unsigned int num_kernels, bool retain_internal_weights = false,
1630  : _are_reshaped(are_reshaped), _kernel_width(kernel_width), _kernel_height(kernel_height), _num_kernels(num_kernels), _retain_internal_weights(retain_internal_weights), _weight_format(weight_format)
1631  {
1632  }
1633  /** Flag which specifies if the weights tensor has been reshaped.
1634  *
1635  * @return True if the weights tensors has been reshaped
1636  */
1637  bool are_reshaped() const
1638  {
1639  return _are_reshaped;
1640  };
1641  /** Return the number of convolution kernels
1642  *
1643  * @return The number of convolution kernels
1644  */
1645  unsigned int num_kernels() const
1646  {
1647  return _num_kernels;
1648  };
1649  /** Return the width and height of the kernel
1650  *
1651  * @return The width and height of the kernel
1652  */
1653  std::pair<unsigned int, unsigned int> kernel_size() const
1654  {
1655  return std::make_pair(_kernel_width, _kernel_height);
1656  }
1658  {
1659  return _retain_internal_weights;
1660  }
1662  {
1663  return _weight_format;
1664  }
1666  {
1667  _weight_format = weight_format;
1668  }
1669 
1670  unsigned int kernel_width() const
1671  {
1672  return _kernel_width;
1673  }
1674  unsigned int kernel_height() const
1675  {
1676  return _kernel_height;
1677  }
1678 
1679 private:
1680  bool _are_reshaped;
1681  unsigned int _kernel_width;
1682  unsigned int _kernel_height;
1683  unsigned int _num_kernels;
1684  bool _retain_internal_weights;
1685  arm_compute::WeightFormat _weight_format;
1686 };
1687 
1688 /** GEMM reshape information class. This class stores the necessary information about matrix A and matrix B reshape.
1689  *
1690  * The matrix A can only be reshaped through @ref opencl::kernels::ClGemmReshapeLhsMatrixKernel or @ref cpu::kernels::CpuGemmInterleave4x4Kernel
1691  * Note: Optionally just for @ref opencl::kernels::ClGemmReshapeLhsMatrixKernel is it possible to set mult_interleave4x4_height, the multiplication factor for the height of the 4x4 interleaved block
1692  *
1693  * The matrix B can only be reshaped through @ref opencl::kernels::ClGemmReshapeRhsMatrixKernel or @ref cpu::kernels::CpuGemmTranspose1xWKernel
1694  * Note: Optionally just for @ref opencl::kernels::ClGemmReshapeRhsMatrixKernel is it possible to set mult_transpose1xW_width, the multiplication factor for the width of the 1xW transposed block
1695  *
1696  */
1697 class GEMMReshapeInfo final
1698 {
1699 public:
1700  /** Default constructor */
1702  : _m(1), _n(1), _k(1), _mult_transpose1xW_width(1), _mult_interleave4x4_height(1), _depth_output_gemm3d(0), _reinterpret_input_as_3d(false), _broadcast_bias(false)
1703  {
1704  }
1705  /** Constructor
1706  *
1707  * @param[in] m Number of matrix A rows
1708  * @param[in] n Number of matrix B columns
1709  * @param[in] k Number of matrix A columns or matrix B rows
1710  * @param[in] mult_transpose1xW_width (Optional) Multiplication factor for the width of the 1xW transposed block
1711  * @param[in] mult_interleave4x4_height (Optional) Multiplication factor for the height of the 4x4 interleaved block
1712  * @param[in] depth_output_gemm3d (Optional) Depth (third dimension) of the output tensor to be used with the GEMM3D kernel.
1713  * If 0 the output will not be reinterpreted as 3D. Default 0
1714  * @param[in] reinterpret_input_as_3d (Optional) Reinterpret the input as 3D tensor. (i.e. this flag should be set to true when GEMM is used
1715  * to perform 1x1 convolutions with the NHWC data layout)
1716  * @param[in] broadcast_bias (Optional) Broadcast the shape of the bias tensor from a vector to a matrix.
1717  */
1719  : _m(m), _n(n), _k(k), _mult_transpose1xW_width(mult_transpose1xW_width), _mult_interleave4x4_height(mult_interleave4x4_height), _depth_output_gemm3d(depth_output_gemm3d),
1720  _reinterpret_input_as_3d(reinterpret_input_as_3d), _broadcast_bias(broadcast_bias)
1721  {
1722  }
1723  /** Number of matrix A rows
1724  *
1725  * @return the number of matrix A rows
1726  */
1727  int m() const
1728  {
1729  return _m;
1730  }
1731  /** Number of matrix B columns
1732  *
1733  * @return the number of matrix B columns
1734  */
1735  int n() const
1736  {
1737  return _n;
1738  }
1739  /** Number of matrix A columns or matrix B rows
1740  *
1741  * @return the number of matrix A columns or matrix B rows
1742  */
1743  int k() const
1744  {
1745  return _k;
1746  }
1747  /** Multiplication factor for the width of the 1xW transposed block
1748  *
1749  * @return the multiplication factor for the width of the 1xW transposed block
1750  */
1752  {
1753  return _mult_transpose1xW_width;
1754  }
1755  /** Multiplication factor for the height of the 4x4 interleaved block
1756  *
1757  * @return the multiplication factor for the height of the 4x4 interleaved block
1758  */
1760  {
1761  return _mult_interleave4x4_height;
1762  }
1763  /** Depth (third dimension) of the output tensor to be used with the GEMM3D kernel
1764  *
1765  * @note GEMM3D kernel is used when the output has to be reinterpret as 3D tensor. In that case:
1766  * m = depth_output_gemm3d * output_height
1767  *
1768  * @return the depth of the output tensor to be used with the GEMM3D kernel
1769  */
1771  {
1772  return _depth_output_gemm3d;
1773  }
1774  /** Flag which specifies if the input tensor has to be reinterpreted as 3D
1775  *
1776  * @return True if the input tensor has to be reinterpreted as 3D tensor
1777  */
1779  {
1780  return _reinterpret_input_as_3d;
1781  };
1782  /** Flag which specifies whether to broadcast the shape of the bias tensor.
1783  *
1784  * @return True if the shape of the bias tensor is to be broadcasted.
1785  */
1786  bool broadcast_bias() const
1787  {
1788  return _broadcast_bias;
1789  };
1790 
1791 private:
1792  int _m;
1793  int _n;
1794  int _k;
1795  int _mult_transpose1xW_width;
1796  int _mult_interleave4x4_height;
1797  int _depth_output_gemm3d;
1798  bool _reinterpret_input_as_3d;
1799  bool _broadcast_bias;
1800 };
1801 
1802 /** GEMM LHS (Left Hand Side) matrix information */
1804 {
1805  GEMMLHSMatrixInfo() = default;
1806  GEMMLHSMatrixInfo(unsigned int m, unsigned int k, unsigned int v, bool trans, bool inter)
1807  : m0(m), k0(k), v0(v), transpose(trans), interleave(inter)
1808  {
1809  }
1810  unsigned int m0{ 1 }; /**< Number of rows processed by the matrix multiplication */
1811  unsigned int k0{ 1 }; /**< Number of partial accumulations performed by the matrix multiplication */
1812  unsigned int v0{ 1 }; /**< Number of vertical blocks of size (m0xk0) stored on the same output row */
1813  bool transpose{ true }; /**< True if the (m0xk0) block has to be transposed before been stored */
1814  bool interleave{ true }; /**< True if the v0 (m0xk0) blocks have to be interleaved in the output row */
1815 };
1816 
1817 /** GEMM RHS (Right Hand Side) matrix information */
1819 {
1820  GEMMRHSMatrixInfo() = default;
1821  GEMMRHSMatrixInfo(unsigned int n, unsigned int k, unsigned int h, bool trans, bool inter, bool export_to_cl_img)
1822  : n0(n), k0(k), h0(h), transpose(trans), interleave(inter), export_to_cl_image(export_to_cl_img)
1823  {
1824  }
1825  unsigned int n0{ 1 }; /**< Number of columns processed by the matrix multiplication */
1826  unsigned int k0{ 1 }; /**< Number of partial accumulations performed by the matrix multiplication */
1827  unsigned int h0{ 1 }; /**< Number of horizontal blocks of size (k0xn0) stored on the same output row */
1828  bool transpose{ true }; /**< True if the (k0xn0) block has to be transposed before been stored */
1829  bool interleave{ true }; /**< True if the h0 (k0xn0) blocks have to be interleaved in the output row */
1830  bool export_to_cl_image{ false }; /**< True if the reshaped rhs has to be exported to cl_image. n0 must be equal to 4 */
1831 };
1832 
1833 class ITensorInfo;
1834 
1835 /** Winograd information */
1837 {
1838  /** Default constructor
1839  *
1840  * @param[in] output_tile_sz Width and height of the output tile
1841  * @param[in] kernel_sz Width and height of the kernel
1842  * @param[in] input_dims Width and height of the input tensor before the convolution is applied
1843  * @param[in] conv_info Convolution info (Pads, strides)
1844  * @param[in] data_layout Data layout to use for the output tensor once the convolution has been applied
1845  */
1848  {
1849  }
1850 
1851  Size2D output_tile_size{}; /**< Width and height of the output tile */
1852  Size2D kernel_size{}; /**< Width and height of the kernel*/
1853  Size2D input_dimensions{}; /**< Width and height of the input tensor before the convolution is applied */
1854  PadStrideInfo convolution_info{}; /**< Convolution info (Pads, strides,...) */
1855  DataLayout output_data_layout{ DataLayout::NCHW }; /**< Data layout to use for the output tensor once the convolution has been applied (NCHW or NHWC) */
1856 };
1857 
1858 /** IO formatting information class*/
1860 {
1861  /** Precision type used when printing floating point numbers */
1862  enum class PrecisionType
1863  {
1864  Default, /**< Default precision to the one that the current stream has */
1865  Custom, /**< Custom precision specified by the user using the precision parameter */
1866  Full /**< The maximum precision of the floating point representation */
1867  };
1868 
1869  /** Specifies the area to be printed, used by Tensor objects */
1870  enum class PrintRegion
1871  {
1872  ValidRegion, /**< Prints the valid region of the Tensor object */
1873  NoPadding, /**< Prints the Tensor object without the padding */
1874  Full /**< Print the tensor object including padding */
1875  };
1876 
1877  /** Construct a set of IO formatting information.
1878  *
1879  * @param[in] print_region Area to be printed. Used by Tensor objects. Default: ValidRegion.
1880  * @param[in] precision_type Precision type for floating point numbers. Default: stream default.
1881  * @param[in] precision Precision value for float point numbers. Default: 10.
1882  * @param[in] align_columns Whether to align columns when printed. Default: true.
1883  * @param[in] element_delim Delimeter between elements. Default: " ".
1884  * @param[in] row_delim Delimenter between rows. Default: "\n".
1885  */
1888  unsigned int precision = 10,
1889  bool align_columns = true,
1890  std::string element_delim = " ",
1891  std::string row_delim = "\n")
1898  {
1899  }
1900 
1901  /** Area to be printed by Tensor objects */
1903  /** Floating point precision type */
1905  /** Floating point precision */
1906  unsigned int precision;
1907  /** Element delimeter */
1908  std::string element_delim;
1909  /** Row delimeter */
1910  std::string row_delim;
1911  /** Align columns */
1913 };
1914 
1915 /** Class for holding information related to cropping */
1917 } // namespace arm_compute
1918 #endif /* ACL_ARM_COMPUTE_CORE_TYPES */
arm_compute::DataLayout::NCHW
@ NCHW
Num samples, channels, height, width.
arm_compute::BorderSize::BorderSize
constexpr BorderSize(unsigned int size) noexcept
Border with equal size around the 2D plane.
Definition: Types.h:254
arm_compute::BorderSize::BorderSize
constexpr BorderSize(unsigned int top, unsigned int right, unsigned int bottom, unsigned int left)
Border with different sizes.
Definition: Types.h:269
arm_compute::NMSType::GAUSSIAN
@ GAUSSIAN
Gaussian NMS.
arm_compute::GenerateProposalsInfo::nms_thres
float nms_thres() const
Definition: Types.h:1325
arm_compute::IOFormatInfo::PrecisionType::Custom
@ Custom
Custom precision specified by the user using the precision parameter.
arm_compute::PriorBoxLayerInfo::max_sizes
std::vector< float > max_sizes() const
Get max sizes.
Definition: Types.h:743
arm_compute::BorderSize::right
unsigned int right
right of the border
Definition: Types.h:351
arm_compute::ValidRegion::ValidRegion
ValidRegion(const Coordinates &an_anchor, const TensorShape &a_shape, size_t num_dimensions)
Constructor for a valid region with specified number of dimensions.
Definition: Types.h:182
arm_compute::ComparisonOperation::LessEqual
@ LessEqual
Less equal comparison ( )
arm_compute::BorderMode::CONSTANT
@ CONSTANT
Pixels outside the image are assumed to have a constant value.
arm_compute::DetectionWindow::x
uint16_t x
Top-left x coordinate.
Definition: Types.h:482
arm_compute::PoolingLayerInfo::use_kernel_indices
bool use_kernel_indices
Definition: Types.h:1127
arm_compute::PriorBoxLayerInfo::min_sizes
std::vector< float > min_sizes() const
Get min sizes.
Definition: Types.h:708
arm_compute::IOFormatInfo::PrecisionType::Full
@ Full
The maximum precision of the floating point representation.
arm_compute::DetectionOutputLayerInfo::variance_encoded_in_target
bool variance_encoded_in_target() const
Get if variance encoded in target.
Definition: Types.h:844
arm_compute::ComputeAnchorsInfo::feat_height
float feat_height() const
Definition: Types.h:1377
arm_compute::Pooling3dLayerInfo::Pooling3dLayerInfo
Pooling3dLayerInfo(PoolingType pool_type, unsigned int pool_size, Size3D stride=Size3D(1U, 1U, 1U), Padding3D padding=Padding3D(), bool exclude_padding=false, bool fp_mixed_precision=false, DimensionRoundingType round_type=DimensionRoundingType::FLOOR)
Constructor.
Definition: Types.h:1157
arm_compute::WeightsInfo
Convolution Layer Weights Information class.
Definition: Types.h:1611
arm_compute::ArithmeticOperation::MAX
@ MAX
Max(x, y)
arm_compute::ReductionOperation::PROD
@ PROD
Product.
arm_compute::ConvolutionMethod::FFT
@ FFT
Convolution using FFT.
arm_compute::ReductionOperation::MIN
@ MIN
Min.
arm_compute::WinogradInfo::output_data_layout
DataLayout output_data_layout
Data layout to use for the output tensor once the convolution has been applied (NCHW or NHWC)
Definition: Types.h:1855
arm_compute::DetectionOutputLayerInfo::share_location
bool share_location() const
Get share location.
Definition: Types.h:834
arm_compute::NormalizationLayerInfo::kappa
float kappa() const
Get the kappa value.
Definition: Types.h:1513
arm_compute::DetectionOutputLayerInfo::num_classes
int num_classes() const
Get num classes.
Definition: Types.h:829
arm_compute::PriorBoxLayerInfo::clip
bool clip() const
Get the clip value.
Definition: Types.h:738
arm_compute::PoolingLayerInfo::PoolingLayerInfo
PoolingLayerInfo(PoolingType pool_type, unsigned int pool_size, DataLayout data_layout, PadStrideInfo pad_stride_info=PadStrideInfo(), bool exclude_padding=false, bool fp_mixed_precision=false, bool use_inf_as_limit=true, bool use_kernel_indices=false)
Constructor.
Definition: Types.h:1046
arm_compute::PoolingType::L2
@ L2
L2 Pooling.
arm_compute::BoxNMSLimitInfo::score_thresh
float score_thresh() const
Get the score threshold.
Definition: Types.h:533
arm_compute::ROIPoolingLayerInfo::pooled_width
unsigned int pooled_width() const
Get the pooled width of the layer.
Definition: Types.h:1249
arm_compute::PaddingList
std::vector< PaddingInfo > PaddingList
List of padding information.
Definition: Types.h:413
arm_compute::DetectionOutputLayerInfo::keep_top_k
int keep_top_k() const
Get the number of total bounding boxes to be kept per image.
Definition: Types.h:849
arm_compute::PriorBoxLayerInfo::aspect_ratios
std::vector< float > aspect_ratios() const
Get aspect ratios.
Definition: Types.h:748
arm_compute::Dimensions::set
void set(size_t dimension, T value, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
Definition: Dimensions.h:76
arm_compute::GEMMRHSMatrixInfo::n0
unsigned int n0
Number of columns processed by the matrix multiplication.
Definition: Types.h:1825
arm_compute::GEMMRHSMatrixInfo::GEMMRHSMatrixInfo
GEMMRHSMatrixInfo()=default
arm_compute::DataLayout
DataLayout
[DataLayout enum definition]
Definition: CoreTypes.h:109
arm_compute::PoolingLayerInfo::PoolingLayerInfo
PoolingLayerInfo()
Default Constructor.
Definition: Types.h:1021
arm_compute::DetectionPostProcessLayerInfo::dequantize_scores
bool dequantize_scores() const
Get dequantize_scores value.
Definition: Types.h:1000
arm_compute::WinogradInfo::WinogradInfo
WinogradInfo(Size2D output_tile_sz, Size2D kernel_sz, Size2D input_dims, PadStrideInfo conv_info, DataLayout data_layout)
Default constructor.
Definition: Types.h:1846
arm_compute::ComparisonOperation::Equal
@ Equal
Equal comparison ( )
arm_compute::BilinearInterpolation
BilinearInterpolation
Bilinear Interpolation method used by LKTracker.
Definition: Types.h:379
arm_compute::Padding2D::bottom
size_t bottom
Padding across the height dimension on the bottom, in elements.
Definition: Types.h:614
arm_compute::Pooling3dLayerInfo::stride
Size3D stride
Definition: Types.h:1225
arm_compute::WeightFormat::ANY
@ ANY
arm_compute::BorderSize
Container for 2D border size.
Definition: Types.h:242
arm_compute::NormType::IN_MAP_1D
@ IN_MAP_1D
Normalization applied within the same map in 1D region.
arm_compute::ROIPoolingLayerInfo::ROIPoolingLayerInfo
ROIPoolingLayerInfo(unsigned int pooled_width, unsigned int pooled_height, float spatial_scale, unsigned int sampling_ratio=0)
Constructor.
Definition: Types.h:1244
arm_compute::Coordinates2D::y
int32_t y
Y coordinates.
Definition: Types.h:398
arm_compute::NormalizationLayerInfo::alpha
float alpha() const
Get the alpha value.
Definition: Types.h:1503
arm_compute::GEMMReshapeInfo
GEMM reshape information class.
Definition: Types.h:1697
arm_compute::BoundingBoxTransformInfo::correct_transform_coords
bool correct_transform_coords() const
Definition: Types.h:1459
arm_compute::BorderMode::UNDEFINED
@ UNDEFINED
Borders are left undefined.
arm_compute::BorderSize::operator==
bool operator==(const BorderSize &rhs) const
Check equality with another BorderSize struct.
Definition: Types.h:322
arm_compute::StridedSliceLayerInfo::shrink_axis_mask
int32_t shrink_axis_mask() const
Definition: Types.h:1581
arm_compute::GEMMReshapeInfo::k
int k() const
Number of matrix A columns or matrix B rows.
Definition: Types.h:1743
arm_compute::DetectionPostProcessLayerInfo::nms_score_threshold
float nms_score_threshold() const
Get nms threshold.
Definition: Types.h:956
arm_compute::GenerateProposalsInfo::im_height
float im_height() const
Definition: Types.h:1300
arm_compute::SamplingPolicy::TOP_LEFT
@ TOP_LEFT
Samples are taken at pixel top left corner.
arm_compute::GEMMReshapeInfo::n
int n() const
Number of matrix B columns.
Definition: Types.h:1735
arm_compute::InterpolationPolicy::AREA
@ AREA
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
arm_compute::SamplingPolicy
SamplingPolicy
Available Sampling Policies.
Definition: Types.h:85
arm_compute::DetectionOutputLayerCodeType
DetectionOutputLayerCodeType
Available Detection Output code types.
Definition: Types.h:771
arm_compute::DetectionPostProcessLayerInfo::max_detections
unsigned int max_detections() const
Get max detections.
Definition: Types.h:941
arm_compute::TensorShape
Shape of a tensor.
Definition: TensorShape.h:39
arm_compute::NormalizationLayerInfo::NormalizationLayerInfo
NormalizationLayerInfo(NormType type, uint32_t norm_size=5, float alpha=0.0001f, float beta=0.5f, float kappa=1.f, bool is_scaled=true)
Default Constructor.
Definition: Types.h:1488
arm_compute::ComparisonOperation::Greater
@ Greater
Greater comparison ( )
arm_compute::PoolingLayerInfo::data_layout
DataLayout data_layout
Definition: Types.h:1121
arm_compute::PriorBoxLayerInfo::img_size
Coordinates2D img_size() const
Get the image size coordinates.
Definition: Types.h:723
arm_compute::DetectionPostProcessLayerInfo::iou_threshold
float iou_threshold() const
Get intersection over union threshold.
Definition: Types.h:961
arm_compute::DetectionOutputLayerCodeType::CORNER_SIZE
@ CORNER_SIZE
Use box centers and size.
arm_compute::support::cpp11::lowest
T lowest()
Definition: ToolchainSupport.h:277
arm_compute::Padding3D
Padding information for 3D operations like Conv3d.
Definition: Types.h:618
arm_compute::Rectangle
Rectangle type.
Definition: Types.h:386
arm_compute::PoolingLayerInfo::exclude_padding
bool exclude_padding
Definition: Types.h:1123
arm_compute::ArithmeticOperation::PRELU
@ PRELU
y*x if x < 0, x otherwise
ConvolutionInfo.h
ActivationLayerInfo.h
arm_compute::GenerateProposalsInfo::values_per_roi
size_t values_per_roi() const
Definition: Types.h:1340
arm_compute::IOFormatInfo::precision_type
PrecisionType precision_type
Floating point precision type.
Definition: Types.h:1904
arm_compute::WinogradInfo::output_tile_size
Size2D output_tile_size
Width and height of the output tile.
Definition: Types.h:1851
arm_compute::ConvolutionMethod::INDIRECT
@ INDIRECT
Indirect convolution.
arm_compute::GenerateProposalsInfo::post_nms_topN
int post_nms_topN() const
Definition: Types.h:1320
arm_compute::GenerateProposalsInfo::spatial_scale
float spatial_scale() const
Definition: Types.h:1335
arm_compute::DeconvolutionMethod
DeconvolutionMethod
Available DeconvolutionMethod.
Definition: Types.h:110
arm_compute::GEMMLHSMatrixInfo::interleave
bool interleave
True if the v0 (m0xk0) blocks have to be interleaved in the output row.
Definition: Types.h:1814
arm_compute::GEMMRHSMatrixInfo::export_to_cl_image
bool export_to_cl_image
True if the reshaped rhs has to be exported to cl_image.
Definition: Types.h:1830
arm_compute::WinogradInfo
Winograd information.
Definition: Types.h:1836
arm_compute::PoolingLayerInfo::PoolingLayerInfo
PoolingLayerInfo(PoolingType pool_type, DataLayout data_layout)
Constructor.
Definition: Types.h:1106
arm_compute::PriorBoxLayerInfo::PriorBoxLayerInfo
PriorBoxLayerInfo()
Default Constructor.
Definition: Types.h:647
arm_compute::interleave_by
int interleave_by(const WeightFormat wf)
Definition: Types.h:1593
arm_compute::WinogradInfo::input_dimensions
Size2D input_dimensions
Width and height of the input tensor before the convolution is applied.
Definition: Types.h:1853
arm_compute::DetectionWindow::score
float score
Confidence value for the detection window.
Definition: Types.h:487
arm_compute::Size2D
Class for specifying the size of an image or rectangle.
Definition: Size2D.h:34
arm_compute::InterpolationPolicy
InterpolationPolicy
Interpolation method.
Definition: Types.h:371
arm_compute::BorderSize::top
unsigned int top
top of the border
Definition: Types.h:350
arm_compute::WeightsInfo::kernel_height
unsigned int kernel_height() const
Definition: Types.h:1674
arm_compute::IOFormatInfo::precision
unsigned int precision
Floating point precision.
Definition: Types.h:1906
arm_compute::DepthwiseConvolutionFunction
DepthwiseConvolutionFunction
Available DepthwiseConvolutionFunction.
Definition: Types.h:103
arm_compute::DetectionPostProcessLayerInfo::scale_value_x
float scale_value_x() const
Get x scale value.
Definition: Types.h:982
arm_compute::BoundingBoxTransformInfo::scale
float scale() const
Definition: Types.h:1449
arm_compute::WeightsInfo::num_kernels
unsigned int num_kernels() const
Return the number of convolution kernels.
Definition: Types.h:1645
arm_compute::test::validation::k
const unsigned int k
Definition: GEMMMatrixMultiplyNative.cpp:361
arm_compute::WeightsInfo::kernel_width
unsigned int kernel_width() const
Definition: Types.h:1670
arm_compute::NormalizationLayerInfo::scale_coeff
float scale_coeff() const
Return the scaling factor of the normalization function.
Definition: Types.h:1539
arm_compute::BoxNMSLimitInfo::im_height
float im_height() const
Get image height (NMS may suppress boxes whose center sits beyond the image height)
Definition: Types.h:583
arm_compute::BoxNMSLimitInfo
BoxWithNonMaximaSuppressionLimit Information class.
Definition: Types.h:507
arm_compute::PoolingLayerInfo::pool_size
Size2D pool_size
Definition: Types.h:1120
arm_compute::ReductionOperation::MAX
@ MAX
Max.
arm_compute::Pooling3dLayerInfo::padding
Padding3D padding
Definition: Types.h:1226
arm_compute::Padding3D::Padding3D
Padding3D() noexcept
Definition: Types.h:620
arm_compute::DimensionRoundingType
DimensionRoundingType
Dimension rounding type when down-scaling on CNNs.
Definition: CoreTypes.h:132
arm_compute::GEMMLHSMatrixInfo::GEMMLHSMatrixInfo
GEMMLHSMatrixInfo(unsigned int m, unsigned int k, unsigned int v, bool trans, bool inter)
Definition: Types.h:1806
arm_compute::IOFormatInfo::PrintRegion::Full
@ Full
Print the tensor object including padding.
arm_compute::WeightsInfo::are_reshaped
bool are_reshaped() const
Flag which specifies if the weights tensor has been reshaped.
Definition: Types.h:1637
arm_compute::DetectionWindow
Detection window used for the object detection.
Definition: Types.h:480
arm_compute::BorderSize::empty
constexpr bool empty() const
Check if the entire border is zero.
Definition: Types.h:275
arm_compute::Padding2D::top
size_t top
Padding across the height dimension on the top, in elements.
Definition: Types.h:613
Size3D.h
arm_compute::GEMMLHSMatrixInfo::v0
unsigned int v0
Number of vertical blocks of size (m0xk0) stored on the same output row.
Definition: Types.h:1812
arm_compute::ReductionOperation::MEAN_SUM
@ MEAN_SUM
Mean of sum.
arm_compute::ROIPoolingLayerInfo::pooled_height
unsigned int pooled_height() const
Get the pooled height of the layer.
Definition: Types.h:1254
arm_compute::DetectionPostProcessLayerInfo::scale_value_y
float scale_value_y() const
Get y scale value.
Definition: Types.h:976
arm_compute::Padding3D::Padding3D
Padding3D(size_t pad_x, size_t pad_y, size_t pad_z)
Definition: Types.h:624
arm_compute::BoxNMSLimitInfo::BoxNMSLimitInfo
BoxNMSLimitInfo(float score_thresh=0.05f, float nms=0.3f, int detections=100, bool soft_nms_enabled=false, NMSType soft_nms_method=NMSType::LINEAR, float soft_nms_sigma=0.5f, float soft_nms_min_score_thres=0.001f, bool suppress_size=false, float min_size=1.0f, float im_width=1.0f, float im_height=1.0f)
Constructor.
Definition: Types.h:524
arm_compute::ReductionOperation
ReductionOperation
Available reduction operations.
Definition: Types.h:419
arm_compute::StridedSliceLayerInfo::StridedSliceLayerInfo
StridedSliceLayerInfo(int32_t begin_mask=0, int32_t end_mask=0, int32_t shrink_axis_mask=0)
Default Constructor.
Definition: Types.h:1563
arm_compute::PoolingLayerInfo::use_inf_as_limit
bool use_inf_as_limit
Definition: Types.h:1126
arm_compute::BilinearInterpolation::BILINEAR_OLD_NEW
@ BILINEAR_OLD_NEW
Old-new method.
arm_compute::ElementWiseUnary::RSQRT
@ RSQRT
Reverse square root.
arm_compute::ComputeAnchorsInfo
ComputeAnchors information class.
Definition: Types.h:1358
arm_compute::PaddingMode
PaddingMode
Padding mode to use for PadLayer.
Definition: Types.h:125
arm_compute::Pooling3dLayerInfo::pool_type
PoolingType pool_type
Definition: Types.h:1223
arm_compute::GEMMReshapeInfo::reinterpret_input_as_3d
bool reinterpret_input_as_3d() const
Flag which specifies if the input tensor has to be reinterpreted as 3D.
Definition: Types.h:1778
arm_compute::IOFormatInfo::print_region
PrintRegion print_region
Area to be printed by Tensor objects.
Definition: Types.h:1902
arm_compute::PriorBoxLayerInfo::steps
std::array< float, 2 > steps() const
Get the step coordinates.
Definition: Types.h:718
arm_compute::Coordinates3D::x
uint32_t x
X coordinates.
Definition: Types.h:404
arm_compute::BoundingBoxTransformInfo::weights
std::array< float, 4 > weights() const
Definition: Types.h:1429
arm_compute::ArithmeticOperation::POWER
@ POWER
x ^ y
arm_compute::FuseBatchNormalizationType
FuseBatchNormalizationType
Available FuseBatchNormalizationType.
Definition: Types.h:118
arm_compute::IOFormatInfo::PrintRegion::NoPadding
@ NoPadding
Prints the Tensor object without the padding.
arm_compute::GEMMReshapeInfo::m
int m() const
Number of matrix A rows.
Definition: Types.h:1727
arm_compute::test::validation::data_layout
const auto data_layout
Definition: ConvolutionLayer.cpp:406
arm_compute::ValidRegion::ValidRegion
ValidRegion(const Coordinates &an_anchor, const TensorShape &a_shape)
Constructor for a valid region with default number of dimensions.
Definition: Types.h:169
arm_compute::ConvolutionMethod
ConvolutionMethod
Available ConvolutionMethod.
Definition: Types.h:92
arm_compute::PriorBoxLayerInfo::flip
bool flip() const
Get the flip value.
Definition: Types.h:733
arm_compute::StridedSliceLayerInfo::end_mask
int32_t end_mask() const
Definition: Types.h:1575
arm_compute::Padding2D::Padding2D
Padding2D(size_t left, size_t right, size_t top, size_t bottom)
Definition: Types.h:607
arm_compute::BorderSize::BorderSize
constexpr BorderSize() noexcept
Empty border, i.e.
Definition: Types.h:245
arm_compute::BorderSize::operator!=
bool operator!=(const BorderSize &rhs) const
Check non-equality with another BorderSize struct.
Definition: Types.h:333
arm_compute::operator==
bool operator==(const Dimensions< T > &lhs, const Dimensions< T > &rhs)
Check that given dimensions are equal.
Definition: Dimensions.h:276
arm_compute::DetectionOutputLayerCodeType::CORNER
@ CORNER
Use box corners.
arm_compute::test::validation::m
const unsigned int m
Definition: GEMMMatrixMultiplyNative.cpp:359
arm_compute::BoundingBoxTransformInfo::BoundingBoxTransformInfo
BoundingBoxTransformInfo(float img_width, float img_height, float scale, bool apply_scale=false, const std::array< float, 4 > weights={ { 1.f, 1.f, 1.f, 1.f } }, bool correct_transform_coords=false, float bbox_xform_clip=4.135166556742356f)
Constructor.
Definition: Types.h:1421
arm_compute::ElementWiseUnary::SIN
@ SIN
Sine.
arm_compute::BBox
std::array< float, 4 > BBox
Definition: Types.h:766
arm_compute::Padding2D::right
size_t right
Padding across the width dimension on the right, in elements.
Definition: Types.h:612
arm_compute::utils::cast::U
U
Definition: SaturateCast.h:64
arm_compute::ElementWiseUnary::ABS
@ ABS
Absolute value.
arm_compute::DetectionOutputLayerInfo::DetectionOutputLayerInfo
DetectionOutputLayerInfo(int num_classes, bool share_location, DetectionOutputLayerCodeType code_type, int keep_top_k, float nms_threshold, int top_k=-1, int background_label_id=-1, float confidence_threshold=std::numeric_limits< float >::lowest(), bool variance_encoded_in_target=false, float eta=1)
Constructor.
Definition: Types.h:812
arm_compute::BorderSize::uniform
constexpr bool uniform() const
Check if the border is the same size on all sides.
Definition: Types.h:281
arm_compute::Coordinates3D::y
uint32_t y
Y coordinates.
Definition: Types.h:405
ARM_COMPUTE_ERROR_ON
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:467
arm_compute::IOFormatInfo::PrintRegion::ValidRegion
@ ValidRegion
Prints the valid region of the Tensor object.
arm_compute::BorderSize::bottom
unsigned int bottom
bottom of the border
Definition: Types.h:352
arm_compute::block_by
int block_by(const WeightFormat wf)
Definition: Types.h:1597
arm_compute::ConvertPolicy::WRAP
@ WRAP
Wrap around.
arm_compute::WeightsInfo::retain_internal_weights
bool retain_internal_weights() const
Definition: Types.h:1657
arm_compute::ComparisonOperation::Less
@ Less
Less comparison ( )
arm_compute::BorderSize::limit
void limit(const BorderSize &limit)
Limit this border size.
Definition: Types.h:342
arm_compute::WeightFormat
WeightFormat
Memory layouts for the weights tensor.
Definition: CoreTypes.h:305
arm_compute::BoxNMSLimitInfo::soft_nms_enabled
bool soft_nms_enabled() const
Check if soft NMS is enabled.
Definition: Types.h:548
Coordinates.h
arm_compute::DetectionPostProcessLayerInfo::max_classes_per_detection
unsigned int max_classes_per_detection() const
Get max_classes per detection.
Definition: Types.h:946
arm_compute::DetectionOutputLayerInfo::confidence_threshold
float confidence_threshold() const
Get confidence threshold.
Definition: Types.h:869
arm_compute::Padding2D::left
size_t left
Padding across the width dimension on the left, in elements.
Definition: Types.h:611
arm_compute::Padding3D::top
size_t top
Padding across the height dimenstion on the top, in elements.
Definition: Types.h:636
arm_compute::ComparisonOperation
ComparisonOperation
Supported comparison operations.
Definition: Types.h:133
arm_compute::NormalizationLayerInfo::is_scaled
bool is_scaled() const
Get the is_scaled value.
Definition: Types.h:1518
arm_compute::DetectionPostProcessLayerInfo::scale_value_w
float scale_value_w() const
Get w scale value.
Definition: Types.h:994
arm_compute::WeightsInfo::kernel_size
std::pair< unsigned int, unsigned int > kernel_size() const
Return the width and height of the kernel.
Definition: Types.h:1653
arm_compute::ReductionOperation::SUM_SQUARE
@ SUM_SQUARE
Sum of squares.
arm_compute::PaddingMode::REFLECT
@ REFLECT
arm_compute::DetectionOutputLayerCodeType::TF_CENTER
@ TF_CENTER
Use box centers and size but flip x and y co-ordinates.
arm_compute::GEMMRHSMatrixInfo::k0
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
Definition: Types.h:1826
arm_compute::DetectionWindow::width
uint16_t width
Width of the detection window.
Definition: Types.h:484
arm_compute::Rectangle::height
uint16_t height
Height of the rectangle.
Definition: Types.h:391
arm_compute::GEMMLHSMatrixInfo::m0
unsigned int m0
Number of rows processed by the matrix multiplication.
Definition: Types.h:1810
arm_compute::WeightsInfo::weight_format
arm_compute::WeightFormat weight_format() const
Definition: Types.h:1661
arm_compute::PoolingType::AVG
@ AVG
Average Pooling.
arm_compute::IOFormatInfo::PrecisionType
PrecisionType
Precision type used when printing floating point numbers.
Definition: Types.h:1862
arm_compute::BitwiseOperation::AND
@ AND
Bitwise AND operation.
arm_compute::BitwiseOperation
BitwiseOperation
Available bitwise operations.
Definition: Types.h:458
arm_compute::ArithmeticOperation::MIN
@ MIN
Min(x, y)
arm_compute::DetectionPostProcessLayerInfo::DetectionPostProcessLayerInfo
DetectionPostProcessLayerInfo(unsigned int max_detections, unsigned int max_classes_per_detection, float nms_score_threshold, float iou_threshold, unsigned int num_classes, std::array< float, 4 > scales_values, bool use_regular_nms=false, unsigned int detection_per_class=100, bool dequantize_scores=true)
Constructor.
Definition: Types.h:927
arm_compute::Rectangle::x
uint16_t x
Top-left x coordinate.
Definition: Types.h:388
arm_compute::ValidRegion
Container for valid region of a window.
Definition: Types.h:144
Bfloat16.h
arm_compute::PoolingLayerInfo
Pooling Layer Information struct.
Definition: Types.h:1018
arm_compute::IOFormatInfo::IOFormatInfo
IOFormatInfo(PrintRegion print_region=PrintRegion::ValidRegion, PrecisionType precision_type=PrecisionType::Default, unsigned int precision=10, bool align_columns=true, std::string element_delim=" ", std::string row_delim="\n")
Construct a set of IO formatting information.
Definition: Types.h:1886
arm_compute::Pooling3dLayerInfo::exclude_padding
bool exclude_padding
Definition: Types.h:1227
arm_compute::FuseBatchNormalizationType::CONVOLUTION
@ CONVOLUTION
For Convolution weights.
arm_compute::BoxNMSLimitInfo::suppress_size
bool suppress_size() const
Get if NMS will suppress boxes based on their size/position.
Definition: Types.h:568
arm_compute::NormalizationLayerInfo::norm_size
uint32_t norm_size() const
Get the normalization size.
Definition: Types.h:1498
arm_compute::IOFormatInfo::PrecisionType::Default
@ Default
Default precision to the one that the current stream has.
arm_compute::BorderMode::REPLICATE
@ REPLICATE
Pixels outside the image are assumed to have the same value as the closest image pixel.
arm_compute::Pooling3dLayerInfo::is_global_pooling
bool is_global_pooling
Definition: Types.h:1228
arm_compute::BorderSize::BorderSize
constexpr BorderSize(unsigned int top_bottom, unsigned int left_right)
Border with same size for top/bottom and left/right.
Definition: Types.h:263
arm_compute::DetectionPostProcessLayerInfo::DetectionPostProcessLayerInfo
DetectionPostProcessLayerInfo()
Default Constructor.
Definition: Types.h:903
arm_compute::ComparisonOperation::NotEqual
@ NotEqual
NotEqual comparison ( )
arm_compute::DetectionOutputLayerInfo
Detection Output layer info.
Definition: Types.h:780
arm_compute::ConvertPolicy::SATURATE
@ SATURATE
Saturate.
arm_compute::DetectionOutputLayerInfo::background_label_id
int background_label_id() const
Get background label ID.
Definition: Types.h:864
arm_compute::ConvolutionMethod::WINOGRAD
@ WINOGRAD
Convolution using Winograd.
CoreTypes.h
arm_compute::NMSType
NMSType
Available non maxima suppression types.
Definition: Types.h:499
arm_compute::PoolingType
PoolingType
Available pooling types.
Definition: Types.h:491
arm_compute::BorderSize::operator*=
BorderSize & operator*=(float scale)
Scale this border size.
Definition: Types.h:292
arm_compute::DepthwiseConvolutionFunction::OPTIMIZED
@ OPTIMIZED
Optimized Depthwise Convolution.
arm_compute::ValidRegion::start
int start(unsigned int d) const
Return the start of the valid region for the given dimension d.
Definition: Types.h:190
arm_compute::DetectionOutputLayerInfo::top_k
int top_k() const
Get top K.
Definition: Types.h:874
arm_compute::ConvolutionMethod::GEMM_CONV2D
@ GEMM_CONV2D
Direct 2D GEMM convolution.
arm_compute::DetectionWindow::idx_class
uint16_t idx_class
Index of the class.
Definition: Types.h:486
arm_compute::WeightsInfo::set_weight_format
void set_weight_format(arm_compute::WeightFormat weight_format)
Definition: Types.h:1665
arm_compute::BoundingBoxTransformInfo::img_height
float img_height() const
Definition: Types.h:1439
arm_compute::BoxNMSLimitInfo::soft_nms_method
NMSType soft_nms_method() const
Get soft NMS method.
Definition: Types.h:553
arm_compute::Pooling3dLayerInfo::fp_mixed_precision
bool fp_mixed_precision
Definition: Types.h:1229
arm_compute::FuseBatchNormalizationType::DEPTHWISECONVOLUTION
@ DEPTHWISECONVOLUTION
For Depthwise Convolution weights.
arm_compute::Padding3D::back
size_t back
Padding across the depth dimenstion on the back, in elements.
Definition: Types.h:639
arm_compute::BitwiseOperation::XOR
@ XOR
Bitwise XOR operation
arm_compute::Padding3D::front
size_t front
Padding across the depth dimenstion on the front, in elements.
Definition: Types.h:638
arm_compute::ConvolutionMethod::GEMM
@ GEMM
Convolution using GEMM.
arm_compute::ComputeAnchorsInfo::values_per_roi
size_t values_per_roi() const
Definition: Types.h:1395
arm_compute::is_fixed_format
bool is_fixed_format(const WeightFormat &wf)
Definition: Types.h:1601
arm_compute::GenerateProposalsInfo::im_width
float im_width() const
Definition: Types.h:1305
IPostOp.h
arm_compute::DeconvolutionMethod::GEMM
@ GEMM
Deconvolution using GEMM.
arm_compute::IOFormatInfo::PrintRegion
PrintRegion
Specifies the area to be printed, used by Tensor objects.
Definition: Types.h:1870
arm_compute::ElementWiseUnary::NEG
@ NEG
Negate.
arm_compute::ReductionOperation::ARG_IDX_MAX
@ ARG_IDX_MAX
Index of the max value.
arm_compute::NormType::IN_MAP_2D
@ IN_MAP_2D
Normalization applied within the same map in 2D region.
arm_compute::GEMMReshapeInfo::broadcast_bias
bool broadcast_bias() const
Flag which specifies whether to broadcast the shape of the bias tensor.
Definition: Types.h:1786
arm_compute::NormalizationLayerInfo::is_cross_map
bool is_cross_map() const
Check if normalization is cross map.
Definition: Types.h:1523
arm_compute::Pooling3dLayerInfo::round_type
DimensionRoundingType round_type
Definition: Types.h:1230
arm_compute::PriorBoxLayerInfo
PriorBox layer info.
Definition: Types.h:643
Size2D.h
arm_compute::ValidRegion::operator==
friend bool operator==(const ValidRegion &lhs, const ValidRegion &rhs)
Check whether two valid regions are equal.
Definition: Types.h:228
arm_compute::IOFormatInfo::row_delim
std::string row_delim
Row delimeter.
Definition: Types.h:1910
arm_compute::GEMMReshapeInfo::GEMMReshapeInfo
GEMMReshapeInfo(int m, int n, int k, int mult_transpose1xW_width=1, int mult_interleave4x4_height=1, int depth_output_gemm3d=0, bool reinterpret_input_as_3d=false, bool broadcast_bias=false)
Constructor.
Definition: Types.h:1718
arm_compute::Coordinates
Coordinates of an item.
Definition: Coordinates.h:37
arm_compute::ArithmeticOperation::SQUARED_DIFF
@ SQUARED_DIFF
(x - y)^2
arm_compute::Pooling3dLayerInfo::Pooling3dLayerInfo
Pooling3dLayerInfo() noexcept
Default Constructor.
Definition: Types.h:1134
arm_compute::DetectionOutputLayerInfo::eta
float eta() const
Get eta.
Definition: Types.h:859
arm_compute::PadStrideInfo
Definition: CoreTypes.h:138
arm_compute::DetectionPostProcessLayerInfo
Detection Output layer info.
Definition: Types.h:899
arm_compute::BoundingBoxTransformInfo::apply_scale
bool apply_scale() const
Definition: Types.h:1454
arm_compute::ConvolutionMethod::DIRECT
@ DIRECT
Direct convolution.
MAX
#define MAX(x, y)
Definition: elementwise_operation_quantized.cl:28
arm_compute::WeightFormat::UNSPECIFIED
@ UNSPECIFIED
arm_compute::InterpolationPolicy::BILINEAR
@ BILINEAR
Output values are defined by bilinear interpolation between the pixels.
arm_compute::Coordinates2D::x
int32_t x
X coordinates.
Definition: Types.h:397
arm_compute::Size3D
Class for specifying the size of a 3D shape or object.
Definition: Size3D.h:32
arm_compute::ArithmeticOperation::SUB
@ SUB
(x - y)
arm_compute::ArithmeticOperation::DIV
@ DIV
(x / y)
arm_compute::BoxNMSLimitInfo::im_width
float im_width() const
Get image width (NMS may suppress boxes whose center sits beyond the image width)
Definition: Types.h:578
arm_compute::BoundingBoxTransformInfo
Bounding Box Transform information class.
Definition: Types.h:1408
arm_compute::BoundingBoxTransformInfo::bbox_xform_clip
float bbox_xform_clip() const
Definition: Types.h:1434
FullyConnectedLayerInfo.h
arm_compute::GEMMLHSMatrixInfo::GEMMLHSMatrixInfo
GEMMLHSMatrixInfo()=default
arm_compute::Pooling3dLayerInfo
Pooling Layer Information struct.
Definition: Types.h:1131
arm_compute::GEMMRHSMatrixInfo::interleave
bool interleave
True if the h0 (k0xn0) blocks have to be interleaved in the output row.
Definition: Types.h:1829
arm_compute::GEMMReshapeInfo::GEMMReshapeInfo
GEMMReshapeInfo()
Default constructor.
Definition: Types.h:1701
arm_compute::GenerateProposalsInfo::pre_nms_topN
int pre_nms_topN() const
Definition: Types.h:1315
arm_compute::Coordinates3D::z
uint32_t z
Z coordinates.
Definition: Types.h:406
arm_compute::DetectionWindow::height
uint16_t height
Height of the detection window.
Definition: Types.h:485
arm_compute::DetectionOutputLayerInfo::nms_threshold
float nms_threshold() const
Get nms threshold.
Definition: Types.h:854
arm_compute::PriorBoxLayerInfo::offset
float offset() const
Get the offset.
Definition: Types.h:728
arm_compute::is_fixed_format_fast_math
bool is_fixed_format_fast_math(const WeightFormat &wf)
Definition: Types.h:1605
arm_compute::Padding3D::left
size_t left
Padding across the width dimenstion on the left, in elements.
Definition: Types.h:634
arm_compute::GEMMLHSMatrixInfo
GEMM LHS (Left Hand Side) matrix information.
Definition: Types.h:1803
arm_compute::DimensionRoundingType::FLOOR
@ FLOOR
Floor rounding.
MatMulInfo.h
arm_compute::PriorBoxLayerInfo::PriorBoxLayerInfo
PriorBoxLayerInfo(const std::vector< float > &min_sizes, const std::vector< float > &variances, float offset, bool flip=true, bool clip=false, const std::vector< float > &max_sizes={}, const std::vector< float > &aspect_ratios={}, const Coordinates2D &img_size=Coordinates2D{ 0, 0 }, const std::array< float, 2 > &steps={ { 0.f, 0.f } })
Constructor.
Definition: Types.h:671
arm_compute::PoolingType::MAX
@ MAX
Max Pooling.
arm_compute::ReductionOperation::ARG_IDX_MIN
@ ARG_IDX_MIN
Index of the min value.
arm_compute::BorderSize::operator*
BorderSize operator*(float scale)
Scale a copy of this border size.
Definition: Types.h:308
arm_compute::DetectionPostProcessLayerInfo::scale_value_h
float scale_value_h() const
Get h scale value.
Definition: Types.h:988
arm_compute::PoolingLayerInfo::is_global_pooling
bool is_global_pooling
Definition: Types.h:1124
arm_compute::DetectionPostProcessLayerInfo::use_regular_nms
bool use_regular_nms() const
Get if use regular nms.
Definition: Types.h:971
arm_compute::NormalizationLayerInfo
Normalization Layer Information class.
Definition: Types.h:1475
arm_compute::GEMMReshapeInfo::mult_transpose1xW_width
int mult_transpose1xW_width() const
Multiplication factor for the width of the 1xW transposed block.
Definition: Types.h:1751
arm_compute::ValidRegion::shape
TensorShape shape
Shape of the valid region.
Definition: Types.h:226
arm_compute::GEMMRHSMatrixInfo::transpose
bool transpose
True if the (k0xn0) block has to be transposed before been stored.
Definition: Types.h:1828
arm_compute::WeightsInfo::WeightsInfo
WeightsInfo(bool are_reshaped, unsigned int kernel_width, unsigned int kernel_height, unsigned int num_kernels, bool retain_internal_weights=false, arm_compute::WeightFormat weight_format=arm_compute::WeightFormat::UNSPECIFIED)
Constructor.
Definition: Types.h:1628
arm_compute::DeconvolutionMethod::DIRECT
@ DIRECT
Direct deconvolution.
arm_compute::IOFormatInfo
IO formatting information class.
Definition: Types.h:1859
arm_compute::DetectionOutputLayerInfo::num_loc_classes
int num_loc_classes() const
Get number of location classes.
Definition: Types.h:879
arm_compute::ComputeAnchorsInfo::ComputeAnchorsInfo
ComputeAnchorsInfo(float feat_width, float feat_height, float spatial_scale, size_t values_per_roi=4)
Constructor.
Definition: Types.h:1368
arm_compute::BoxNMSLimitInfo::soft_nms_min_score_thres
float soft_nms_min_score_thres() const
Get soft nms min score threshold.
Definition: Types.h:563
arm_compute::DetectionOutputLayerInfo::code_type
DetectionOutputLayerCodeType code_type() const
Get detection output code type.
Definition: Types.h:839
arm_compute::BoxNMSLimitInfo::soft_nms_sigma
float soft_nms_sigma() const
Get soft NMS sigma.
Definition: Types.h:558
arm_compute::GEMMReshapeInfo::depth_output_gemm3d
int depth_output_gemm3d() const
Depth (third dimension) of the output tensor to be used with the GEMM3D kernel.
Definition: Types.h:1770
arm_compute::test::validation::scale
NEScale scale
Definition: Scale.cpp:272
arm_compute::BoxNMSLimitInfo::nms
float nms() const
Get the NMS.
Definition: Types.h:538
arm_compute
Copyright (c) 2017-2023 Arm Limited.
Definition: introduction.dox:24
arm_compute::NMSType::LINEAR
@ LINEAR
Linear NMS.
arm_compute::NMSType::ORIGINAL
@ ORIGINAL
Original NMS.
arm_compute::Pooling3dLayerInfo::pool_size
Size3D pool_size
Definition: Types.h:1224
arm_compute::test::validation::conv_info
const auto conv_info
Definition: ConvolutionLayer.cpp:407
arm_compute::PaddingMode::SYMMETRIC
@ SYMMETRIC
arm_compute::BilinearInterpolation::BILINEAR_SCHARR
@ BILINEAR_SCHARR
Scharr method.
arm_compute::ElementWiseUnary::EXP
@ EXP
Exponential.
arm_compute::ConvertPolicy
ConvertPolicy
Policy to handle integer overflow.
Definition: Types.h:364
arm_compute::UNKNOWN
@ UNKNOWN
Unknown CL kernel type.
Definition: CLTypes.h:82
arm_compute::StridedSliceLayerInfo::begin_mask
int32_t begin_mask() const
Definition: Types.h:1569
arm_compute::BorderSize::left
unsigned int left
left of the border
Definition: Types.h:353
arm_compute::Dimensions::set_num_dimensions
void set_num_dimensions(size_t num_dimensions)
Set number of dimensions.
Definition: Dimensions.h:149
arm_compute::Multiples
std::vector< uint32_t > Multiples
Information to produce a tiled version of a Tensor.
Definition: Types.h:416
arm_compute::WinogradInfo::kernel_size
Size2D kernel_size
Width and height of the kernel.
Definition: Types.h:1852
arm_compute::NormType::CROSS_MAP
@ CROSS_MAP
Normalization applied cross maps.
arm_compute::PaddingInfo
std::pair< uint32_t, uint32_t > PaddingInfo
Padding information as a pair of unsigned int start/end.
Definition: Types.h:410
arm_compute::GEMMLHSMatrixInfo::transpose
bool transpose
True if the (m0xk0) block has to be transposed before been stored.
Definition: Types.h:1813
arm_compute::ROIPoolingLayerInfo::spatial_scale
float spatial_scale() const
Get the spatial scale.
Definition: Types.h:1259
arm_compute::ComparisonOperation::GreaterEqual
@ GreaterEqual
Greater equal comparison ( )
arm_compute::DetectionPostProcessLayerInfo::num_classes
unsigned int num_classes() const
Get num classes.
Definition: Types.h:966
arm_compute::ValidRegion::end
int end(unsigned int d) const
Return the end of the valid region for the given dimension d.
Definition: Types.h:196
TensorShape.h
arm_compute::DetectionWindow::y
uint16_t y
Top-left y coordinate.
Definition: Types.h:483
arm_compute::ComputeAnchorsInfo::feat_width
float feat_width() const
Definition: Types.h:1383
arm_compute::ArithmeticOperation::ADD
@ ADD
(x + y)
arm_compute::StridedSliceLayerInfo
Definition: Types.h:1554
arm_compute::Coordinates2D
Coordinate type.
Definition: Types.h:395
arm_compute::Padding3D::right
size_t right
Padding across the width dimenstion on the right, in elements.
Definition: Types.h:635
arm_compute::PriorBoxLayerInfo::variances
std::vector< float > variances() const
Get min variances.
Definition: Types.h:713
arm_compute::DepthwiseConvolutionFunction::GENERIC
@ GENERIC
Generic Depthwise Convolution.
arm_compute::InterpolationPolicy::NEAREST_NEIGHBOR
@ NEAREST_NEIGHBOR
Output values are defined to match the source pixel whose center is nearest to the sample position.
arm_compute::PoolingLayerInfo::fp_mixed_precision
bool fp_mixed_precision
Definition: Types.h:1125
arm_compute::BitwiseOperation::NOT
@ NOT
Bitwise NOT operation.
arm_compute::SamplingPolicy::CENTER
@ CENTER
Samples are taken at pixel center.
arm_compute::BorderMode
BorderMode
Methods available to handle borders.
Definition: Types.h:234
arm_compute::IOFormatInfo::align_columns
bool align_columns
Align columns.
Definition: Types.h:1912
arm_compute::PoolingLayerInfo::PoolingLayerInfo
PoolingLayerInfo(PoolingType pool_type, Size2D pool_size, DataLayout data_layout, PadStrideInfo pad_stride_info=PadStrideInfo(), bool exclude_padding=false, bool fp_mixed_precision=false, bool use_inf_as_limit=true, bool use_kernel_indices=false)
Constructor.
Definition: Types.h:1079
Macros.h
arm_compute::DeconvolutionMethod::UPSCALE_CONV2D
@ UPSCALE_CONV2D
Deconvolution with Upscaling.
arm_compute::ValidRegion::set
ValidRegion & set(size_t dimension, int start, size_t size)
Accessor to set the value of anchor and shape for one of the dimensions.
Definition: Types.h:209
arm_compute::Padding3D::bottom
size_t bottom
Padding across the height dimenstion on the bottom, in elements.
Definition: Types.h:637
arm_compute::DetectionOutputLayerCodeType::CENTER_SIZE
@ CENTER_SIZE
Use box centers and size.
arm_compute::NormalizationLayerInfo::beta
float beta() const
Get the beta value.
Definition: Types.h:1508
arm_compute::IOFormatInfo::element_delim
std::string element_delim
Element delimeter.
Definition: Types.h:1908
arm_compute::NormType
NormType
The normalization type used for the normalization layer.
Definition: Types.h:467
arm_compute::GEMMReshapeInfo::mult_interleave4x4_height
int mult_interleave4x4_height() const
Multiplication factor for the height of the 4x4 interleaved block.
Definition: Types.h:1759
arm_compute::GEMMLHSMatrixInfo::k0
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
Definition: Types.h:1811
arm_compute::Padding2D
Padding and stride information class.
Definition: Types.h:604
arm_compute::PaddingMode::CONSTANT
@ CONSTANT
arm_compute::BitwiseOperation::OR
@ OR
Bitwise OR operation
arm_compute::Pooling3dLayerInfo::Pooling3dLayerInfo
Pooling3dLayerInfo(PoolingType pool_type, Size3D pool_size, Size3D stride=Size3D(1U, 1U, 1U), Padding3D padding=Padding3D(), bool exclude_padding=false, bool fp_mixed_precision=false, DimensionRoundingType round_type=DimensionRoundingType::FLOOR)
Constructor.
Definition: Types.h:1187
arm_compute::WinogradInfo::convolution_info
PadStrideInfo convolution_info
Convolution info (Pads, strides,...)
Definition: Types.h:1854
arm_compute::TensorShape::set
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
Definition: TensorShape.h:79
arm_compute::Coordinates3D
Coordinate type.
Definition: Types.h:402
arm_compute::GEMMRHSMatrixInfo::GEMMRHSMatrixInfo
GEMMRHSMatrixInfo(unsigned int n, unsigned int k, unsigned int h, bool trans, bool inter, bool export_to_cl_img)
Definition: Types.h:1821
arm_compute::GEMMRHSMatrixInfo
GEMM RHS (Right Hand Side) matrix information.
Definition: Types.h:1818
arm_compute::DetectionOutputLayerInfo::DetectionOutputLayerInfo
DetectionOutputLayerInfo()
Default Constructor.
Definition: Types.h:784
GEMMInfo.h
arm_compute::DetectionPostProcessLayerInfo::detection_per_class
unsigned int detection_per_class() const
Get detection per class.
Definition: Types.h:951
arm_compute::BoxNMSLimitInfo::detections_per_im
int detections_per_im() const
Get the number of detections.
Definition: Types.h:543
arm_compute::PoolingLayerInfo::pad_stride_info
PadStrideInfo pad_stride_info
Definition: Types.h:1122
arm_compute::Pooling3dLayerInfo::Pooling3dLayerInfo
Pooling3dLayerInfo(PoolingType pool_type)
Constructor.
Definition: Types.h:1211
arm_compute::Dimensions::num_dimensions
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
Definition: Dimensions.h:143
arm_compute::PoolingLayerInfo::pool_type
PoolingType pool_type
Definition: Types.h:1119
arm_compute::Rectangle::width
uint16_t width
Width of the rectangle.
Definition: Types.h:390
arm_compute::GEMMRHSMatrixInfo::h0
unsigned int h0
Number of horizontal blocks of size (k0xn0) stored on the same output row.
Definition: Types.h:1827
arm_compute::ValidRegion::ValidRegion
ValidRegion()
Default constructor.
Definition: Types.h:147
arm_compute::NormalizationLayerInfo::is_in_map
bool is_in_map() const
Check if normalization is not cross map.
Definition: Types.h:1528
arm_compute::ElementWiseUnary::ROUND
@ ROUND
Round.
arm_compute::ROIPoolingLayerInfo
ROI Pooling Layer Information class.
Definition: Types.h:1234
arm_compute::BoundingBoxTransformInfo::img_width
float img_width() const
Definition: Types.h:1444
arm_compute::Rectangle::y
uint16_t y
Top-left y coordinate.
Definition: Types.h:389
arm_compute::ElementWiseUnary::LOGICAL_NOT
@ LOGICAL_NOT
Logical Not.
arm_compute::ValidRegion::operator=
ValidRegion & operator=(const ValidRegion &)=default
Allow instances of this class to be copied.
arm_compute::WeightsInfo::WeightsInfo
WeightsInfo()
Default constructor.
Definition: Types.h:1615
arm_compute::GenerateProposalsInfo
Generate Proposals Information class.
Definition: Types.h:1277
arm_compute::ComputeAnchorsInfo::spatial_scale
float spatial_scale() const
Definition: Types.h:1389
arm_compute::ReductionOperation::SUM
@ SUM
Sum.
arm_compute::ElementWiseUnary
ElementWiseUnary
Available element wise unary operations.
Definition: Types.h:445
arm_compute::GenerateProposalsInfo::im_scale
float im_scale() const
Definition: Types.h:1310
arm_compute::Padding3D::Padding3D
Padding3D(size_t left, size_t right, size_t top, size_t bottom, size_t front, size_t back)
Definition: Types.h:629
arm_compute::BoxNMSLimitInfo::min_size
float min_size() const
Get size suppression threshold.
Definition: Types.h:573
arm_compute::NormalizationLayerInfo::type
NormType type() const
Get the normalization type.
Definition: Types.h:1493
arm_compute::test::validation::n
const unsigned int n
Definition: GEMMMatrixMultiplyNative.cpp:360
arm_compute::ValidRegion::anchor
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:225
arm_compute::GenerateProposalsInfo::min_size
float min_size() const
Definition: Types.h:1330
Coordinates2D
2D Coordinates structure
Definition: types.h:28
arm_compute::LabelBBox
std::map< int, std::vector< BBox > > LabelBBox
Definition: Types.h:768
arm_compute::ROIPoolingLayerInfo::sampling_ratio
unsigned int sampling_ratio() const
Get sampling ratio.
Definition: Types.h:1264
arm_compute::ValidRegion::~ValidRegion
~ValidRegion()=default
Default destructor.
arm_compute::Padding2D::Padding2D
Padding2D()=default
arm_compute::GenerateProposalsInfo::GenerateProposalsInfo
GenerateProposalsInfo(float im_width, float im_height, float im_scale, float spatial_scale=1.0, int pre_nms_topN=6000, int post_nms_topN=300, float nms_thres=0.7, float min_size=16.0, size_t values_per_roi=4)
Constructor.
Definition: Types.h:1292
arm_compute::ElementWiseUnary::LOG
@ LOG
Natural Logarithm.
arm_compute::ArithmeticOperation
ArithmeticOperation
Available element-wise operations.
Definition: Types.h:432