From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- .../classarmnn_utils_1_1_data_layout_indexed.xhtml | 354 +++++++++++++++++++++ 1 file changed, 354 insertions(+) create mode 100644 20.02/classarmnn_utils_1_1_data_layout_indexed.xhtml (limited to '20.02/classarmnn_utils_1_1_data_layout_indexed.xhtml') diff --git a/20.02/classarmnn_utils_1_1_data_layout_indexed.xhtml b/20.02/classarmnn_utils_1_1_data_layout_indexed.xhtml new file mode 100644 index 0000000000..c676479919 --- /dev/null +++ b/20.02/classarmnn_utils_1_1_data_layout_indexed.xhtml @@ -0,0 +1,354 @@ + + + + + + + + + + + + + +ArmNN: DataLayoutIndexed Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.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 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::NCHW, 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;
28  default:
29  throw armnn::InvalidArgumentException("Unknown DataLayout value: " +
30  std::to_string(static_cast<int>(dataLayout)));
31  }
32 }
+ + +
+
+
+

Member Function Documentation

+ +

◆ GetChannelsIndex()

+ + + +

◆ GetDataLayout()

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

Definition at line 22 of file DataLayoutIndexed.hpp.

+ +

Referenced by CompareDepthwiseConvolution2dTestImpl(), armnn::GetOffset(), armnn::Offset(), and armnnUtils::operator==().

+
22 { return m_DataLayout; }
+
+
+ +

◆ 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 27 of file DataLayoutIndexed.hpp.

+ +

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

+ +

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

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

◆ GetWidthIndex()

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