ArmNN
 24.02
Descriptors.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include "armnn/Descriptors.hpp"
6 #include "armnn/Logging.hpp"
7 
10 
11 #include <algorithm>
12 #include <array>
13 #include <vector>
14 
15 #include <fmt/format.h>
16 
17 namespace armnn
18 {
19 
20 PermutationVector::PermutationVector(const ValueType *dimMappings, const SizeType numDimMappings)
21 {
22  // Validation
23 
24  if (numDimMappings > MaxNumOfTensorDimensions)
25  {
27  fmt::format("The number of mappings ({0}) cannot be greater "
28  "than the maximum number of dimensions supported ({1})",
29  numDimMappings,
31  }
32 
33  if ((dimMappings == nullptr) && (numDimMappings != 0))
34  {
35  throw InvalidArgumentException("Dimension mappings must not be NULL if the number of mappings is positive");
36  }
37 
38  for (SizeType i = 0; i < numDimMappings; ++i)
39  {
40  const ValueType dstIndex = dimMappings[i];
41  if (dstIndex >= numDimMappings)
42  {
44  fmt::format("Dimension mapping at index {0} is invalid: "
45  "{1} is outside of the valid range [0,{2}]",
46  i,
47  dstIndex,
48  (numDimMappings - 1)));
49  }
50  }
51 
52  // Validation: Detect duplicates
53  {
54  std::array<bool, MaxNumOfTensorDimensions> observedDims;
55  observedDims.fill(false);
56 
57  for (SizeType i = 0; i < numDimMappings; ++i)
58  {
59  const ValueType dstIndex = dimMappings[i];
60  if (observedDims[dstIndex])
61  {
62  throw InvalidArgumentException("Invalid dimension mappings: Two or more source dimensions are mapped "
63  "to the same output dimension");
64  }
65  observedDims[dstIndex] = true;
66  }
67  }
68 
69  // Initialize
70  for (SizeType i = 0; i < numDimMappings; ++i)
71  {
72  m_DimMappings[i] = dimMappings[i];
73  }
74  m_NumDimMappings = numDimMappings;
75 }
76 
77 PermutationVector::PermutationVector(std::initializer_list<ValueType> dimMappings)
78  : PermutationVector(dimMappings.begin(), armnn::numeric_cast<SizeType>(dimMappings.size()))
79 {
80 }
81 
83 : m_ConcatAxis(1)
84 , m_NumViews(0)
85 , m_NumDimensions(0)
86 , m_ViewOrigins(nullptr)
87 {}
88 
89 OriginsDescriptor::OriginsDescriptor(uint32_t numViews, uint32_t numDimensions /*= 4*/)
90 : m_ConcatAxis(1)
91 , m_NumViews(numViews)
92 , m_NumDimensions(numDimensions)
93 , m_ViewOrigins(numViews && numDimensions > 0 ? new uint32_t *[numViews]() : nullptr)
94 {
95  for (uint32_t i = 0; m_NumDimensions > 0 && i < m_NumViews; ++i)
96  {
97  m_ViewOrigins[i] = new uint32_t[m_NumDimensions]();
98  }
99 }
100 
102 : m_ConcatAxis(other.m_ConcatAxis)
103 , m_NumViews(other.m_NumViews)
104 , m_NumDimensions(other.m_NumDimensions)
105 , m_ViewOrigins(other.m_NumViews && other.m_NumDimensions > 0 ? new uint32_t *[other.m_NumViews]() : nullptr)
106 {
107  for (uint32_t i = 0; m_NumDimensions > 0 && i < m_NumViews; ++i)
108  {
109  m_ViewOrigins[i] = new uint32_t[m_NumDimensions]();
110  memcpy(m_ViewOrigins[i], other.m_ViewOrigins[i], m_NumDimensions * sizeof(uint32_t));
111  }
112 }
113 
116 {
117  swap(*this, other);
118 }
119 
121 {
122  for (uint32_t i = 0; m_NumDimensions > 0 && i < m_NumViews; ++i)
123  {
124  delete[] m_ViewOrigins[i];
125  }
126  delete[] m_ViewOrigins;
127 }
128 
130 {
131  swap(*this, rhs);
132  return *this;
133 }
134 
136 {
137  if (GetNumViews() != rhs.GetNumViews() ||
138  GetNumDimensions() != rhs.GetNumDimensions() ||
139  GetConcatAxis() != rhs.GetConcatAxis())
140  {
141  return false;
142  }
143 
144  for (unsigned int i = 0u; i < GetNumViews(); ++i)
145  {
146  for (unsigned int j = 0u; j < GetNumDimensions(); ++j)
147  {
148  if (GetViewOrigin(i)[j] != rhs.GetViewOrigin(i)[j])
149  {
150  return false;
151  }
152  }
153  }
154 
155  return true;
156 }
157 
158 void OriginsDescriptor::SetConcatAxis(unsigned int concatAxis)
159 {
160  m_ConcatAxis = concatAxis;
161 }
163 {
164  return m_ConcatAxis;
165 }
166 
167 Status OriginsDescriptor::SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value)
168 {
169  if (view >= m_NumViews)
170  {
171  ARMNN_LOG(error) << "OriginsDescriptor::SetViewOriginCoord: view argument:" << view <<
172  " is out of range";
173  return Status::Failure;
174  }
175  if (coord >= m_NumDimensions)
176  {
177  ARMNN_LOG(error) << "OriginsDescriptor::SetViewOriginCoord: coord argument:" << coord <<
178  " is out of range";
179  return Status::Failure;
180  }
181 
182  m_ViewOrigins[view][coord] = value;
183  return Status::Success;
184 }
185 
186 
188 {
189  return m_NumViews;
190 }
191 
193 {
194  return m_NumDimensions;
195 }
196 
197 const uint32_t* OriginsDescriptor::GetViewOrigin(uint32_t idx) const
198 {
199  return m_ViewOrigins ? m_ViewOrigins[idx] : nullptr;
200 }
201 
202 
203 // Reorders the viewOrigins in accordance with the indices presented in newOrdering array.
204 void OriginsDescriptor::ReorderOrigins(unsigned int* newOrdering, unsigned int numNewOrdering)
205 {
206  ARMNN_ASSERT_MSG(m_NumViews == numNewOrdering, "number of views must match number of "
207  "elements in the new ordering array");
208  std::vector<uint32_t*> viewOrigins(&m_ViewOrigins[0], &m_ViewOrigins[m_NumViews]);
209 
210  for (unsigned int i = 0; i < numNewOrdering; ++i)
211  {
212  m_ViewOrigins[i] = viewOrigins[newOrdering[i]];
213  }
214 }
215 
217 : m_Origins()
218 , m_ViewSizes(nullptr)
219 , m_IsAxisSet(false)
220 , m_Axis(0)
221 {}
222 
223 ViewsDescriptor::ViewsDescriptor(uint32_t numViews, uint32_t numDimensions /*= 4*/)
224  : m_Origins(numViews, numDimensions)
225  , m_ViewSizes(numViews > 0 && numDimensions > 0 ?
226  new uint32_t *[numViews]() : nullptr)
227  , m_IsAxisSet(false)
228  , m_Axis(0)
229 {
230  if (m_ViewSizes)
231  {
232  for (uint32_t i = 0; GetNumDimensions() > 0 && i < GetNumViews(); ++i)
233  {
234  m_ViewSizes[i] = new uint32_t[GetNumDimensions()]();
235  }
236  }
237 }
238 
240  : m_Origins(other.m_Origins)
241  , m_ViewSizes(other.GetNumViews() > 0 && other.GetNumDimensions() > 0 ?
242  new uint32_t *[other.GetNumViews()]() : nullptr)
243  , m_IsAxisSet(other.m_IsAxisSet)
244  , m_Axis(other.m_Axis)
245 {
246  if (m_ViewSizes)
247  {
248  for (uint32_t i = 0; GetNumDimensions() > 0 && i < GetNumViews(); ++i)
249  {
250  m_ViewSizes[i] = new uint32_t[GetNumDimensions()]();
251  memcpy(m_ViewSizes[i], other.m_ViewSizes[i], GetNumDimensions() * sizeof(uint32_t));
252  }
253  }
254 }
255 
257  : ViewsDescriptor()
258 {
259  swap(*this, other);
260 }
261 
263 {
264  if (m_ViewSizes)
265  {
266  for (uint32_t i = 0; GetNumDimensions() > 0 && i < GetNumViews(); ++i)
267  {
268  delete[] m_ViewSizes[i];
269  }
270  delete[] m_ViewSizes;
271  }
272 }
273 
275 {
276  swap(*this, rhs);
277  return *this;
278 }
279 
281 {
282  if (GetNumViews() != rhs.GetNumViews() || GetNumDimensions() != rhs.GetNumDimensions())
283  {
284  return false;
285  }
286 
287  for (unsigned int i = 0u; i < GetNumViews(); ++i)
288  {
289  for (unsigned int j = 0u; j < GetNumDimensions(); ++j)
290  {
291  if (GetViewOrigin(i)[j] != rhs.GetViewOrigin(i)[j] || GetViewSizes(i)[j] != rhs.GetViewSizes(i)[j])
292  {
293  return false;
294  }
295  }
296  }
297 
298  return true;
299 }
300 
302 {
303  return m_Origins.GetNumViews();
304 }
305 
307 {
308  return m_Origins.GetNumDimensions();
309 }
310 
311 const uint32_t* ViewsDescriptor::GetViewOrigin(uint32_t idx) const
312 {
313  return m_Origins.GetViewOrigin(idx);
314 }
315 
316 Status ViewsDescriptor::SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value)
317 {
318  return m_Origins.SetViewOriginCoord(view, coord, value);
319 }
320 
321 Status ViewsDescriptor::SetViewSize(uint32_t view, uint32_t coord, uint32_t value)
322 {
323  if (!m_ViewSizes)
324  {
325  ARMNN_LOG(error) << "ViewsDescriptor::SetViewSize: invalid view sizes";
326  return Status::Failure;
327  }
328 
329  if (view >= GetNumViews())
330  {
331  ARMNN_LOG(error) << "ViewsDescriptor::SetViewSize: view argument:" << view <<
332  " is out of range";
333  return Status::Failure;
334  }
335  if (coord >= GetNumDimensions())
336  {
337  ARMNN_LOG(error) << "ViewsDescriptor::SetViewSize: coord argument:" << coord <<
338  " is out of range";
339  return Status::Failure;
340  }
341 
342  m_ViewSizes[view][coord] = value;
343  return Status::Success;
344 }
345 
346 const uint32_t* ViewsDescriptor::GetViewSizes(uint32_t idx) const
347 {
348  return m_ViewSizes ? m_ViewSizes[idx] : nullptr;
349 }
350 
352 {
353  return m_Origins;
354 }
355 
357 {
358  using std::swap;
359  swap(first.m_NumViews, second.m_NumViews);
360  swap(first.m_NumDimensions, second.m_NumDimensions);
361  swap(first.m_ViewOrigins, second.m_ViewOrigins);
362  swap(first.m_ConcatAxis, second.m_ConcatAxis);
363 }
364 
365 void swap(ViewsDescriptor& first, ViewsDescriptor& second)
366 {
367  using std::swap;
368  swap(first.m_Origins, second.m_Origins);
369  swap(first.m_ViewSizes, second.m_ViewSizes);
370  swap(first.m_IsAxisSet, second.m_IsAxisSet);
371  swap(first.m_Axis, second.m_Axis);
372 }
373 
374 void ViewsDescriptor::SetAxis(int32_t axis)
375 {
376  m_Axis = axis;
377  m_IsAxisSet = true;
378 }
379 
380 /// Get the axis value.
382 {
383  return m_Axis;
384 }
385 
386 /// Returns true if an axis has been set.
388 {
389  return m_IsAxisSet;
390 }
391 
393  unsigned int axis) const
394 {
395  int start = m_Begin[axis];
396 
397  if (m_BeginMask & (1 << axis))
398  {
399  if (m_Stride[axis] > 0)
400  {
401  start = std::numeric_limits<int>::min();
402  }
403  else
404  {
405  start = std::numeric_limits<int>::max();
406  }
407  }
408 
409  const int axisSize = armnn::numeric_cast<int>(inputShape[axis]);
410  if (start < 0)
411  {
412  start += (axisSize);
413  }
414 
415  return std::max(0, std::min(start, axisSize - 1));
416 
417 }
418 
420  unsigned int axis,
421  int startForAxis) const
422 {
423 
424  if (m_ShrinkAxisMask & (1 << axis))
425  {
426  return startForAxis + 1;
427  }
428 
429  int stop = m_End[axis];
430 
431  if (m_EndMask & (1 << axis))
432  {
433  if (m_Stride[axis] > 0)
434  {
435  stop = std::numeric_limits<int>::max();
436  }
437  else
438  {
439  stop = std::numeric_limits<int>::min();
440  }
441  }
442 
443  const int axisSize = armnn::numeric_cast<int>(inputShape[axis]);
444  if (stop < 0)
445  {
446  stop += axisSize;
447  }
448 
449  return m_Stride[axis] > 0 ? std::max(0, std::min(stop, axisSize)) :
450  std::max(-1, std::min(stop, axisSize - 1));
451 
452 }
453 
454 uint32_t GetNumInputs(bool biasEnabled)
455 {
456  unsigned int numInputs = 2;
457  if (biasEnabled)
458  {
459  numInputs = 3;
460  }
461  return numInputs;
462 }
463 
465 {
467 }
468 
470 {
472 }
473 
475 {
477 }
478 
480 {
482 }
483 
484 std::pair<unsigned int, unsigned int> BatchMatMulDescriptor::GetAxesToMul(
485  DataLayout dataLayout,
486  const TensorShape& tensorShape)
487 {
488  auto numDims = tensorShape.GetNumDimensions();
489  std::pair<unsigned int, unsigned int> axes = { numDims-2, numDims-1 };
490  switch(dataLayout)
491  {
492  case DataLayout::NDHWC:
493  case DataLayout::NHWC:
494  axes.first -= 1;
495  axes.second -= 1;
496  break;
497  case DataLayout::NCDHW:
498  case DataLayout::NCHW:
499  default:
500  break;
501  }
502  return axes;
503 }
504 
505 std::vector<unsigned int> BatchMatMulDescriptor::GetAxesNotMul(
506  DataLayout dataLayout,
507  const TensorShape& tensorShape)
508 {
509  auto axesToMul = BatchMatMulDescriptor::GetAxesToMul(dataLayout, tensorShape);
510  std::vector<unsigned int> axesNotMul;
511  for(unsigned int i = 0; i < tensorShape.GetNumDimensions(); i++)
512  {
513  if(i == axesToMul.first || i == axesToMul.second)
514  {
515  continue;
516  }
517  axesNotMul.push_back(i);
518  }
519  return axesNotMul;
520 }
521 
523  DataLayout dataLayout,
524  const TensorShape& tensorShape)
525 {
526  std::vector<unsigned int> vec;
527  auto axesToMul = BatchMatMulDescriptor::GetAxesToMul(dataLayout, tensorShape);
528  for(unsigned int i = 0; i < tensorShape.GetNumDimensions(); i++)
529  {
530  if(i == axesToMul.first)
531  {
532  vec.push_back(i+1);
533  }
534  else if(i == axesToMul.second)
535  {
536  vec.push_back(i-1);
537  }
538  else
539  {
540  vec.push_back(i);
541  }
542  }
543  return PermutationVector(vec.data(),
544  static_cast<unsigned int>(vec.size()));
545 }
546 
547 }
armnn::Convolution3dDescriptor::GetNumInputs
uint32_t GetNumInputs() const
Get the number of views/inputs.
Definition: Descriptors.cpp:464
armnn::OriginsDescriptor::GetConcatAxis
unsigned int GetConcatAxis() const
Get the concatenation axis value.
Definition: Descriptors.cpp:162
armnn::ViewsDescriptor
A ViewsDescriptor for the SplitterLayer.
Definition: Descriptors.hpp:244
armnn::OriginsDescriptor::GetNumViews
uint32_t GetNumViews() const
Get the number of views.
Definition: Descriptors.cpp:187
armnn::OriginsDescriptor::~OriginsDescriptor
~OriginsDescriptor()
Definition: Descriptors.cpp:120
armnn::DataLayout::NCDHW
@ NCDHW
armnn::DataLayout
DataLayout
Definition: Types.hpp:62
Descriptors.hpp
armnn::DepthwiseConvolution2dDescriptor::m_BiasEnabled
bool m_BiasEnabled
Enable/disable bias.
Definition: Descriptors.hpp:708
armnn::OriginsDescriptor::ReorderOrigins
void ReorderOrigins(unsigned int *newOrdering, unsigned int numNewOrdering)
Reorders the viewOrigins in accordance with the indices presented in newOrdering array.
Definition: Descriptors.cpp:204
armnn::StridedSliceDescriptor::m_Begin
std::vector< int > m_Begin
Begin values for the input that will be sliced.
Definition: Descriptors.hpp:1342
armnn::DataLayout::NHWC
@ NHWC
armnn::BatchMatMulDescriptor::GetAxesToMul
static std::pair< unsigned int, unsigned int > GetAxesToMul(DataLayout dataLayout, const TensorShape &tensorShape)
Static helper to get the two axes (for each input) for multiplication.
Definition: Descriptors.cpp:484
armnn::ViewsDescriptor::HasAxis
bool HasAxis() const
Returns true if an axis has been set.
Definition: Descriptors.cpp:387
armnn::OriginsDescriptor::GetNumDimensions
uint32_t GetNumDimensions() const
Get the number of dimensions.
Definition: Descriptors.cpp:192
armnn::swap
void swap(OriginsDescriptor &first, OriginsDescriptor &second)
Definition: Descriptors.cpp:356
armnn::BatchMatMulDescriptor::GetPermuteVec
static PermutationVector GetPermuteVec(DataLayout dataLayout, const TensorShape &tensorShape)
Static helper to get the axes which will be transposed.
Definition: Descriptors.cpp:522
armnn::StridedSliceDescriptor::m_BeginMask
int32_t m_BeginMask
Begin mask value.
Definition: Descriptors.hpp:1350
armnn::MaxNumOfTensorDimensions
constexpr unsigned int MaxNumOfTensorDimensions
Definition: Types.hpp:31
ARMNN_ASSERT_MSG
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15
armnn::ViewsDescriptor::SetViewSize
Status SetViewSize(uint32_t view, uint32_t coord, uint32_t value)
Set the size of the views.
Definition: Descriptors.cpp:321
armnn::BoostLogSeverityMapping::error
@ error
armnn::numeric_cast
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:35
NumericCast.hpp
armnn::StridedSliceDescriptor::GetStopForAxis
int GetStopForAxis(const TensorShape &inputShape, unsigned int axis, int startForAxis) const
Definition: Descriptors.cpp:419
ARMNN_LOG
#define ARMNN_LOG(severity)
Definition: Logging.hpp:212
armnn::DataLayout::NDHWC
@ NDHWC
armnn::ViewsDescriptor::GetViewSizes
const uint32_t * GetViewSizes(uint32_t idx) const
Get the view sizes at the int value idx.
Definition: Descriptors.cpp:346
Assert.hpp
armnn::ViewsDescriptor::SetViewOriginCoord
Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value)
@Brief Set the view origin coordinates.
Definition: Descriptors.cpp:316
armnn::TensorShape
Definition: Tensor.hpp:20
armnn::Convolution2dDescriptor::GetNumInputs
uint32_t GetNumInputs() const
Definition: Descriptors.cpp:469
armnn::TensorShape::GetNumDimensions
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
Definition: Tensor.cpp:174
armnn::ViewsDescriptor::GetAxis
int32_t GetAxis() const
Get the axis value.
Definition: Descriptors.cpp:381
armnn::FullyConnectedDescriptor::m_BiasEnabled
bool m_BiasEnabled
Enable/disable bias.
Definition: Descriptors.hpp:526
armnn::OriginsDescriptor::operator=
OriginsDescriptor & operator=(OriginsDescriptor rhs)
Definition: Descriptors.cpp:129
Logging.hpp
armnn::ViewsDescriptor::GetOrigins
const OriginsDescriptor & GetOrigins() const
Get the View Origins.
Definition: Descriptors.cpp:351
armnn::Convolution2dDescriptor::m_BiasEnabled
bool m_BiasEnabled
Enable/disable bias.
Definition: Descriptors.hpp:582
armnn::InvalidArgumentException
Definition: Exceptions.hpp:80
armnn::PermutationVector
Definition: Types.hpp:314
armnn::OriginsDescriptor::swap
friend void swap(OriginsDescriptor &first, OriginsDescriptor &second)
Swap the ViewsDescriptor values first and second.
Definition: Descriptors.cpp:356
armnn::Status::Success
@ Success
armnn::StridedSliceDescriptor::m_EndMask
int32_t m_EndMask
End mask value.
Definition: Descriptors.hpp:1353
armnn::OriginsDescriptor::SetConcatAxis
void SetConcatAxis(unsigned int concatAxis)
Set the concatenation axis value.
Definition: Descriptors.cpp:158
armnn::ViewsDescriptor::ViewsDescriptor
ViewsDescriptor()
Definition: Descriptors.cpp:216
armnn::ViewsDescriptor::operator==
bool operator==(const ViewsDescriptor &rhs) const
Definition: Descriptors.cpp:280
armnn::GetNumInputs
uint32_t GetNumInputs(bool biasEnabled)
Definition: Descriptors.cpp:454
armnn::StridedSliceDescriptor::m_ShrinkAxisMask
int32_t m_ShrinkAxisMask
Shrink axis mask value. If set, the nth specification shrinks the dimensionality by 1.
Definition: Descriptors.hpp:1355
armnn::ViewsDescriptor::operator=
ViewsDescriptor & operator=(ViewsDescriptor rhs)
Definition: Descriptors.cpp:274
armnn::StridedSliceDescriptor::m_Stride
std::vector< int > m_Stride
Stride values for the input that will be sliced.
Definition: Descriptors.hpp:1346
armnn::Status
Status
Definition: Types.hpp:42
armnn::StridedSliceDescriptor::GetStartForAxis
int GetStartForAxis(const TensorShape &inputShape, unsigned int axis) const
Definition: Descriptors.cpp:392
armnn::ViewsDescriptor::GetNumDimensions
uint32_t GetNumDimensions() const
Get the number of dimensions.
Definition: Descriptors.cpp:306
armnn::OriginsDescriptor::OriginsDescriptor
OriginsDescriptor()
Definition: Descriptors.cpp:82
armnn::OriginsDescriptor
An OriginsDescriptor for the ConcatLayer.
Definition: Descriptors.hpp:201
armnn::FullyConnectedDescriptor::GetNumInputs
uint32_t GetNumInputs() const
Get the number of inputs.
Definition: Descriptors.cpp:474
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::Convolution3dDescriptor::m_BiasEnabled
bool m_BiasEnabled
Enable/disable bias.
Definition: Descriptors.hpp:653
armnn::PermutationVector::ValueType
unsigned int ValueType
Definition: Types.hpp:317
armnn::OriginsDescriptor::SetViewOriginCoord
Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value)
@Brief Set the view origin coordinates.
Definition: Descriptors.cpp:167
armnn::ViewsDescriptor::GetNumViews
uint32_t GetNumViews() const
Get the number of views.
Definition: Descriptors.cpp:301
armnn::StridedSliceDescriptor::m_End
std::vector< int > m_End
End values for the input that will be sliced.
Definition: Descriptors.hpp:1344
armnn::ViewsDescriptor::swap
friend void swap(ViewsDescriptor &first, ViewsDescriptor &second)
Swap the ViewsDescriptor value first and second.
Definition: Descriptors.cpp:365
armnn::OriginsDescriptor::GetViewOrigin
const uint32_t * GetViewOrigin(uint32_t idx) const
Return the view origin at the int value idx.
Definition: Descriptors.cpp:197
armnn::PermutationVector::PermutationVector
PermutationVector(const ValueType *dimMappings, SizeType numDimMappings)
Definition: Descriptors.cpp:20
armnn::PermutationVector::SizeType
unsigned int SizeType
Definition: Types.hpp:318
armnn::BatchMatMulDescriptor::GetAxesNotMul
static std::vector< unsigned int > GetAxesNotMul(DataLayout dataLayout, const TensorShape &tensorShape)
Static helper to get the axes (for each input) that will not be multiplied together.
Definition: Descriptors.cpp:505
armnn::swap
void swap(ViewsDescriptor &first, ViewsDescriptor &second)
Definition: Descriptors.cpp:365
armnn::ViewsDescriptor::~ViewsDescriptor
~ViewsDescriptor()
Definition: Descriptors.cpp:262
armnn::Status::Failure
@ Failure
armnn::ViewsDescriptor::SetAxis
void SetAxis(int32_t axis)
Set the axis value.
Definition: Descriptors.cpp:374
armnn::DataLayout::NCHW
@ NCHW
armnn::ViewsDescriptor::GetViewOrigin
const uint32_t * GetViewOrigin(uint32_t idx) const
Get the view origin at the int value idx.
Definition: Descriptors.cpp:311
armnn::DepthwiseConvolution2dDescriptor::GetNumInputs
uint32_t GetNumInputs() const
Get the number of views/inputs.
Definition: Descriptors.cpp:479
armnn::OriginsDescriptor::operator==
bool operator==(const OriginsDescriptor &rhs) const
Definition: Descriptors.cpp:135