From 8efb48a6847c5cd166c561127ae6611150963ce3 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Fri, 19 May 2023 11:14:28 +0100 Subject: Update Doxygen docu for 23.05 Signed-off-by: Nikhil Raj Change-Id: I0a992286f14fa68fcc6e5eba31ac39fed003cbbe --- .../classarmnn_utils_1_1_data_layout_indexed.xhtml | 455 +++++++++++++++++++++ 1 file changed, 455 insertions(+) create mode 100644 23.05/classarmnn_utils_1_1_data_layout_indexed.xhtml (limited to '23.05/classarmnn_utils_1_1_data_layout_indexed.xhtml') diff --git a/23.05/classarmnn_utils_1_1_data_layout_indexed.xhtml b/23.05/classarmnn_utils_1_1_data_layout_indexed.xhtml new file mode 100644 index 0000000000..7eff05f824 --- /dev/null +++ b/23.05/classarmnn_utils_1_1_data_layout_indexed.xhtml @@ -0,0 +1,455 @@ + + + + + + + + + + + + + +ArmNN: DataLayoutIndexed Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.05 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
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  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  }
+
+

References ARMNN_ASSERT, 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 ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
+ + + + + + -- cgit v1.2.1