From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- ...reference_2workloads_2_gather_8cpp_source.xhtml | 132 +++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 21.02/backends_2reference_2workloads_2_gather_8cpp_source.xhtml (limited to '21.02/backends_2reference_2workloads_2_gather_8cpp_source.xhtml') diff --git a/21.02/backends_2reference_2workloads_2_gather_8cpp_source.xhtml b/21.02/backends_2reference_2workloads_2_gather_8cpp_source.xhtml new file mode 100644 index 0000000000..cf348d627d --- /dev/null +++ b/21.02/backends_2reference_2workloads_2_gather_8cpp_source.xhtml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + +ArmNN: src/backends/reference/workloads/Gather.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Gather.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "Gather.hpp"
7 
8 #include "RefWorkloadUtils.hpp"
9 
13 
14 namespace armnn
15 {
16 
17 void Gather(const TensorInfo& paramsInfo,
18  const TensorInfo& indicesInfo,
19  const TensorInfo& outputInfo,
20  Decoder<float>& params,
21  const int32_t* indices,
22  Encoder<float>& output,
23  const int32_t axis)
24 {
25  IgnoreUnused(outputInfo);
26  IgnoreUnused(axis);
27 
28  const TensorShape& paramsShape = paramsInfo.GetShape();
29 
30  unsigned int paramsProduct = 1;
31  for (unsigned int i = 1; i < paramsInfo.GetNumDimensions(); ++i)
32  {
33  paramsProduct = paramsProduct * paramsShape[i];
34  }
35 
36  unsigned int outIndex = 0;
37  for (unsigned int i = 0; i < indicesInfo.GetNumElements(); ++i)
38  {
39  unsigned int indx = armnn::numeric_cast<unsigned int>(indices[i]);
40 
41  ARMNN_ASSERT(indices[i] >= 0 && indx < paramsShape[0]);
42 
43  unsigned int startOffset = indx * paramsProduct;
44  unsigned int endOffset = startOffset + paramsProduct;
45 
46  for (unsigned int j = startOffset; j < endOffset; ++j)
47  {
48  params[j];
49  float outputValue = params.Get();
50  output[outIndex];
51  output.Set(outputValue);
52  ++outIndex;
53  }
54  }
55 
56  ARMNN_ASSERT(outIndex == outputInfo.GetNumElements());
57 }
58 
59 } //namespace armnn
+ +
const TensorShape & GetShape() const
Definition: Tensor.hpp:187
+ + +
virtual void Set(IType right)=0
+ +
Copyright (c) 2021 ARM Limited and Contributors.
+
void IgnoreUnused(Ts &&...)
+ + +
virtual IType Get() const =0
+
void Gather(const TensorInfo &paramsInfo, const TensorInfo &indicesInfo, const TensorInfo &outputInfo, Decoder< float > &params, const int32_t *indices, Encoder< float > &output, const int32_t axis)
Definition: Gather.cpp:17
+
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
+ +
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:35
+
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:191
+
unsigned int GetNumElements() const
Definition: Tensor.hpp:192
+ +
+
+ + + + -- cgit v1.2.1