From ae050524109f1ce827962665436ef7430f2ac479 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Wed, 22 Mar 2023 16:48:58 +0000 Subject: IVGCVSW-7255 Update Doxygen Documentation and publish on GitHub. * Updating Doxygen documentation for 23.02 release. Signed-off-by: David Monahan Change-Id: I545574ff7664b4595d2fe6a91a3c35d2ad55df82 --- 23.02/_data_layout_indexed_8hpp_source.xhtml | 133 +++++++++++++++++++++------ 1 file changed, 105 insertions(+), 28 deletions(-) (limited to '23.02/_data_layout_indexed_8hpp_source.xhtml') diff --git a/23.02/_data_layout_indexed_8hpp_source.xhtml b/23.02/_data_layout_indexed_8hpp_source.xhtml index d9347b4a48..b5b960eabc 100644 --- a/23.02/_data_layout_indexed_8hpp_source.xhtml +++ b/23.02/_data_layout_indexed_8hpp_source.xhtml @@ -8,7 +8,7 @@ - + ArmNN: include/armnnUtils/DataLayoutIndexed.hpp Source File @@ -19,9 +19,6 @@ - @@ -30,7 +27,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -51,18 +49,21 @@ - + +/* @license-end */
@@ -76,7 +77,9 @@ $(function() {
@@ -98,33 +101,107 @@ $(document).ready(function(){initNavTree('_data_layout_indexed_8hpp_source.xhtml
DataLayoutIndexed.hpp
-Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <armnn/Types.hpp>
9 #include <armnn/Tensor.hpp>
10 
11 #include <armnn/utility/Assert.hpp>
12 
13 namespace armnnUtils
14 {
15 
16 /// Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout
18 {
19 public:
21 
22  armnn::DataLayout GetDataLayout() const { return m_DataLayout; }
23  unsigned int GetChannelsIndex() const { return m_ChannelsIndex; }
24  unsigned int GetHeightIndex() const { return m_HeightIndex; }
25  unsigned int GetWidthIndex() const { return m_WidthIndex; }
26  unsigned int GetDepthIndex() const { return m_DepthIndex; }
27 
28  inline unsigned int GetIndex(const armnn::TensorShape& shape,
29  unsigned int batchIndex, unsigned int channelIndex,
30  unsigned int heightIndex, unsigned int widthIndex) const
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  }
61 
62 private:
63  armnn::DataLayout m_DataLayout;
64  unsigned int m_ChannelsIndex;
65  unsigned int m_HeightIndex;
66  unsigned int m_WidthIndex;
67  unsigned int m_DepthIndex;
68 };
69 
70 /// Equality methods
71 bool operator==(const armnn::DataLayout& dataLayout, const DataLayoutIndexed& indexed);
72 bool operator==(const DataLayoutIndexed& indexed, const armnn::DataLayout& dataLayout);
73 
74 } // namespace armnnUtils
DataLayout
Definition: Types.hpp:62
-
unsigned int GetWidthIndex() const
- -
unsigned int GetDepthIndex() const
- -
unsigned int GetHeightIndex() const
-
bool operator==(const armnn::DataLayout &dataLayout, const DataLayoutIndexed &indexed)
Equality methods.
-
DataLayoutIndexed(armnn::DataLayout dataLayout)
-
Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout...
- -
unsigned int GetIndex(const armnn::TensorShape &shape, unsigned int batchIndex, unsigned int channelIndex, unsigned int heightIndex, unsigned int widthIndex) const
-
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
-
armnn::DataLayout GetDataLayout() const
- - - -
unsigned int GetChannelsIndex() const
- +Go to the documentation of this file.
1 //
+
2 // Copyright © 2019 Arm Ltd. All rights reserved.
+
3 // SPDX-License-Identifier: MIT
+
4 //
+
5 
+
6 #pragma once
+
7 
+
8 #include <armnn/Types.hpp>
+
9 #include <armnn/Tensor.hpp>
+
10 
+
11 #include <armnn/utility/Assert.hpp>
+
12 
+
13 namespace armnnUtils
+
14 {
+
15 
+
16 /// Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout
+ +
18 {
+
19 public:
+ +
21 
+
22  armnn::DataLayout GetDataLayout() const { return m_DataLayout; }
+
23  unsigned int GetChannelsIndex() const { return m_ChannelsIndex; }
+
24  unsigned int GetHeightIndex() const { return m_HeightIndex; }
+
25  unsigned int GetWidthIndex() const { return m_WidthIndex; }
+
26  unsigned int GetDepthIndex() const { return m_DepthIndex; }
+
27 
+
28  inline unsigned int GetIndex(const armnn::TensorShape& shape,
+
29  unsigned int batchIndex, unsigned int channelIndex,
+
30  unsigned int heightIndex, unsigned int widthIndex) const
+
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  }
+
61 
+
62 private:
+
63  armnn::DataLayout m_DataLayout;
+
64  unsigned int m_ChannelsIndex;
+
65  unsigned int m_HeightIndex;
+
66  unsigned int m_WidthIndex;
+
67  unsigned int m_DepthIndex;
+
68 };
+
69 
+
70 /// Equality methods
+
71 bool operator==(const armnn::DataLayout& dataLayout, const DataLayoutIndexed& indexed);
+
72 bool operator==(const DataLayoutIndexed& indexed, const armnn::DataLayout& dataLayout);
+
73 
+
74 } // namespace armnnUtils
+
unsigned int GetIndex(const armnn::TensorShape &shape, unsigned int batchIndex, unsigned int channelIndex, unsigned int heightIndex, unsigned int widthIndex) const
+
DataLayout
Definition: Types.hpp:62
+
unsigned int GetDepthIndex() const
+
armnn::DataLayout GetDataLayout() const
+
unsigned int GetWidthIndex() const
+ +
unsigned int GetChannelsIndex() const
+ + + + + +
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
+
Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout.
+
unsigned int GetHeightIndex() const
+ +
bool operator==(const armnn::DataLayout &dataLayout, const DataLayoutIndexed &indexed)
Equality methods.
+
DataLayoutIndexed(armnn::DataLayout dataLayout)
-- cgit v1.2.1