From 8d2ca734165a068478df7cffa46185680b05cd20 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Fri, 24 Feb 2023 10:28:19 +0000 Subject: Update Doxygen docu for 23.02 Signed-off-by: Nikhil Raj Change-Id: Ie6c19a27d50fefab2796b2b5875374e81f5bf971 --- .../classarmnn_utils_1_1_data_layout_indexed.xhtml | 388 +++++++++++++++++++++ 1 file changed, 388 insertions(+) create mode 100644 23.02/classarmnn_utils_1_1_data_layout_indexed.xhtml (limited to '23.02/classarmnn_utils_1_1_data_layout_indexed.xhtml') diff --git a/23.02/classarmnn_utils_1_1_data_layout_indexed.xhtml b/23.02/classarmnn_utils_1_1_data_layout_indexed.xhtml new file mode 100644 index 0000000000..fef41b4873 --- /dev/null +++ b/23.02/classarmnn_utils_1_1_data_layout_indexed.xhtml @@ -0,0 +1,388 @@ + + + + + + + + + + + + + +ArmNN: DataLayoutIndexed Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
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.

+ +

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

+
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 }
+ + + + +
+
+
+

Member Function Documentation

+ +

◆ GetChannelsIndex()

+ + + +

◆ GetDataLayout()

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

Definition at line 22 of file DataLayoutIndexed.hpp.

+ +

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

+
22 { return m_DataLayout; }
+
+
+ +

◆ GetDepthIndex()

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

Definition at line 26 of file DataLayoutIndexed.hpp.

+ +

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

+
26 { return m_DepthIndex; }
+
+
+ +

◆ 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.

+ +

References ARMNN_ASSERT, armnn::NCHW, armnn::NHWC, and armnnUtils::operator==().

+ +

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

+
31  {
32  ARMNN_ASSERT( batchIndex < shape[0] || ( shape[0] == 0 && batchIndex == 0 ) );
33  ARMNN_ASSERT( channelIndex < shape[m_ChannelsIndex] ||
34  ( shape[m_ChannelsIndex] == 0 && channelIndex == 0) );
35  ARMNN_ASSERT( heightIndex < shape[m_HeightIndex] ||
36  ( shape[m_HeightIndex] == 0 && heightIndex == 0) );
37  ARMNN_ASSERT( widthIndex < shape[m_WidthIndex] ||
38  ( shape[m_WidthIndex] == 0 && widthIndex == 0) );
39 
40  /// Offset the given indices appropriately depending on the data layout
41  switch (m_DataLayout)
42  {
44  batchIndex *= shape[1] * shape[2] * shape[3]; // batchIndex *= heightIndex * widthIndex * channelIndex
45  heightIndex *= shape[m_WidthIndex] * shape[m_ChannelsIndex];
46  widthIndex *= shape[m_ChannelsIndex];
47  /// channelIndex stays unchanged
48  break;
50  default:
51  batchIndex *= shape[1] * shape[2] * shape[3]; // batchIndex *= heightIndex * widthIndex * channelIndex
52  channelIndex *= shape[m_HeightIndex] * shape[m_WidthIndex];
53  heightIndex *= shape[m_WidthIndex];
54  /// widthIndex stays unchanged
55  break;
56  }
57 
58  /// Get the value using the correct offset
59  return batchIndex + channelIndex + heightIndex + widthIndex;
60  }
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
+ + +
+
+
+ +

◆ GetWidthIndex()

+ + +
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1