From 03c7ff3f6188240baaeaeb405a357a0c58195fec Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Tue, 22 Aug 2023 12:00:04 +0100 Subject: IVGCVSW-7702 Update Doxygen Docu for 23.08 Signed-off-by: Nikhil Raj Change-Id: I357a9f7e47614589327c1ac5d95b6224ff77103d --- .../classarmnn_utils_1_1_data_layout_indexed.html | 464 +++++++++++++++++++++ 1 file changed, 464 insertions(+) create mode 100644 latest/classarmnn_utils_1_1_data_layout_indexed.html (limited to 'latest/classarmnn_utils_1_1_data_layout_indexed.html') diff --git a/latest/classarmnn_utils_1_1_data_layout_indexed.html b/latest/classarmnn_utils_1_1_data_layout_indexed.html new file mode 100644 index 0000000000..2527dfa05f --- /dev/null +++ b/latest/classarmnn_utils_1_1_data_layout_indexed.html @@ -0,0 +1,464 @@ + + + + + + + + +Arm NN: DataLayoutIndexed Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.08 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
DataLayoutIndexed Class Reference
+
+
+ +

Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout. + More...

+ +

#include <DataLayoutIndexed.hpp>

+ + + + + + + + + + + + + + + + +

+Public Member Functions

 DataLayoutIndexed (armnn::DataLayout dataLayout)
 
armnn::DataLayout GetDataLayout () const
 
unsigned int GetChannelsIndex () const
 
unsigned int GetHeightIndex () const
 
unsigned int GetWidthIndex () const
 
unsigned int GetDepthIndex () const
 
unsigned int GetIndex (const armnn::TensorShape &shape, unsigned int batchIndex, unsigned int channelIndex, unsigned int heightIndex, unsigned int widthIndex) const
 
+

Detailed Description

+

Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout.

+ +

Definition at line 17 of file DataLayoutIndexed.hpp.

+

Constructor & Destructor Documentation

+ +

◆ DataLayoutIndexed()

+ +
+
+ + + + + + + + +
DataLayoutIndexed (armnn::DataLayout dataLayout)
+
+ +

Definition at line 13 of file DataLayoutIndexed.cpp.

+
14  : m_DataLayout(dataLayout)
+
15 {
+
16  switch (dataLayout)
+
17  {
+ +
19  m_ChannelsIndex = 3;
+
20  m_HeightIndex = 1;
+
21  m_WidthIndex = 2;
+
22  break;
+ +
24  m_ChannelsIndex = 1;
+
25  m_HeightIndex = 2;
+
26  m_WidthIndex = 3;
+
27  break;
+ +
29  m_DepthIndex = 1;
+
30  m_HeightIndex = 2;
+
31  m_WidthIndex = 3;
+
32  m_ChannelsIndex = 4;
+
33  break;
+ +
35  m_ChannelsIndex = 1;
+
36  m_DepthIndex = 2;
+
37  m_HeightIndex = 3;
+
38  m_WidthIndex = 4;
+
39  break;
+
40  default:
+
41  throw armnn::InvalidArgumentException("Unknown DataLayout value: " +
+
42  std::to_string(static_cast<int>(dataLayout)));
+
43  }
+
44 }
+
+

References armnn::NCDHW, armnn::NCHW, armnn::NDHWC, and armnn::NHWC.

+ +
+
+

Member Function Documentation

+ +

◆ GetChannelsIndex()

+ + + +

◆ GetDataLayout()

+ +
+
+ + + + + +
+ + + + + + + +
armnn::DataLayout GetDataLayout () const
+
+inline
+
+ +

Definition at line 22 of file DataLayoutIndexed.hpp.

+
22 { return m_DataLayout; }
+
+

Referenced by armnn::Convolve(), armnn::Convolve3d(), armnn::GetOffset(), armnn::Offset(), armnnUtils::operator==(), and armnn::Pooling2d().

+ +
+
+ +

◆ GetDepthIndex()

+ +
+
+ + + + + +
+ + + + + + + +
unsigned int GetDepthIndex () const
+
+inline
+
+ +

Definition at line 26 of file DataLayoutIndexed.hpp.

+
26 { return m_DepthIndex; }
+
+

Referenced by armnn::Convolve3d(), Pooling3dLayer::InferOutputShapes(), Convolution3dLayer::InferOutputShapes(), and armnn::Pooling3d().

+ +
+
+ +

◆ GetHeightIndex()

+ + + +

◆ GetIndex()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
unsigned int GetIndex (const armnn::TensorShapeshape,
unsigned int batchIndex,
unsigned int channelIndex,
unsigned int heightIndex,
unsigned int widthIndex 
) const
+
+inline
+
+

Offset the given indices appropriately depending on the data layout

+

channelIndex stays unchanged

+

widthIndex stays unchanged

+

Get the value using the correct offset

+ +

Definition at line 28 of file DataLayoutIndexed.hpp.

+
31  {
+
32  if (batchIndex >= shape[0] && !( shape[0] == 0 && batchIndex == 0))
+
33  {
+
34  throw armnn::Exception("Unable to get batch index", CHECK_LOCATION());
+
35  }
+
36  if (channelIndex >= shape[m_ChannelsIndex] &&
+
37  !(shape[m_ChannelsIndex] == 0 && channelIndex == 0))
+
38  {
+
39  throw armnn::Exception("Unable to get channel index", CHECK_LOCATION());
+
40 
+
41  }
+
42  if (heightIndex >= shape[m_HeightIndex] &&
+
43  !( shape[m_HeightIndex] == 0 && heightIndex == 0))
+
44  {
+
45  throw armnn::Exception("Unable to get height index", CHECK_LOCATION());
+
46  }
+
47  if (widthIndex >= shape[m_WidthIndex] &&
+
48  ( shape[m_WidthIndex] == 0 && widthIndex == 0))
+
49  {
+
50  throw armnn::Exception("Unable to get width index", CHECK_LOCATION());
+
51  }
+
52 
+
53  /// Offset the given indices appropriately depending on the data layout
+
54  switch (m_DataLayout)
+
55  {
+ +
57  batchIndex *= shape[1] * shape[2] * shape[3]; // batchIndex *= heightIndex * widthIndex * channelIndex
+
58  heightIndex *= shape[m_WidthIndex] * shape[m_ChannelsIndex];
+
59  widthIndex *= shape[m_ChannelsIndex];
+
60  /// channelIndex stays unchanged
+
61  break;
+ +
63  default:
+
64  batchIndex *= shape[1] * shape[2] * shape[3]; // batchIndex *= heightIndex * widthIndex * channelIndex
+
65  channelIndex *= shape[m_HeightIndex] * shape[m_WidthIndex];
+
66  heightIndex *= shape[m_WidthIndex];
+
67  /// widthIndex stays unchanged
+
68  break;
+
69  }
+
70 
+
71  /// Get the value using the correct offset
+
72  return batchIndex + channelIndex + heightIndex + widthIndex;
+
73  }
+
+

References CHECK_LOCATION, armnn::NCHW, and armnn::NHWC.

+ +

Referenced by armnn::BatchNormImpl(), TensorBufferArrayView< DataType >::Get(), armnn::InstanceNorm(), armnn::Resize(), and armnn::TransposeConvolution2dImpl().

+ +
+
+ +

◆ GetWidthIndex()

+ + +
The documentation for this class was generated from the following files: +
+
+ + +
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
+ + +
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46
+ + + + + -- cgit v1.2.1