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 --- 20.02/_arg_min_max_8cpp_source.xhtml | 129 +++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 20.02/_arg_min_max_8cpp_source.xhtml (limited to '20.02/_arg_min_max_8cpp_source.xhtml') diff --git a/20.02/_arg_min_max_8cpp_source.xhtml b/20.02/_arg_min_max_8cpp_source.xhtml new file mode 100644 index 0000000000..c9d3836b6f --- /dev/null +++ b/20.02/_arg_min_max_8cpp_source.xhtml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + +ArmNN: src/backends/reference/workloads/ArgMinMax.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ArgMinMax.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "ArgMinMax.hpp"
7 
9 
10 #include <boost/numeric/conversion/cast.hpp>
11 
12 namespace armnn
13 {
14 
15 void ArgMinMax(Decoder<float>& in, int32_t* out, const TensorInfo& inputTensorInfo,
16  const TensorInfo& outputTensorInfo, ArgMinMaxFunction function, int axis)
17 {
18  IgnoreUnused(outputTensorInfo);
19 
20  unsigned int uAxis = armnnUtils::GetUnsignedAxis(inputTensorInfo.GetNumDimensions(), axis);
21 
22  const unsigned int outerElements = armnnUtils::GetNumElementsBetween(inputTensorInfo.GetShape(), 0, uAxis);
23  const unsigned int axisSize = inputTensorInfo.GetShape()[uAxis];
24  const unsigned int innerElements = armnnUtils::GetNumElementsBetween(inputTensorInfo.GetShape(),
25  uAxis + 1,
26  inputTensorInfo.GetNumDimensions());
27 
28  for (unsigned int outer = 0; outer < outerElements; ++outer) {
29  for (unsigned int inner = 0; inner < innerElements; ++inner) {
30  in[outer * axisSize * innerElements + inner];
31  auto tmpValue = in.Get();
32  unsigned int tmpIndex = 0;
33  for (unsigned int i = 1; i < axisSize; ++i) {
34  in[(outer * axisSize * innerElements) + (i * innerElements) + inner];
35  const auto& value = in.Get();
36  if ((function == armnn::ArgMinMaxFunction::Min && value < tmpValue) ||
37  (function == armnn::ArgMinMaxFunction::Max && value > tmpValue)) {
38  tmpValue = value;
39  tmpIndex = i;
40  }
41  }
42  out[outer * innerElements + inner] = boost::numeric_cast<int32_t>(tmpIndex);
43  }
44  }
45 }
46 
47 } //namespace armnn
const TensorShape & GetShape() const
Definition: Tensor.hpp:88
+
void ArgMinMax(Decoder< float > &in, int32_t *out, const TensorInfo &inputTensorInfo, const TensorInfo &outputTensorInfo, ArgMinMaxFunction function, int axis)
Definition: ArgMinMax.cpp:15
+ +
unsigned int GetNumElementsBetween(const armnn::TensorShape &shape, unsigned int firstAxisInclusive, unsigned int lastAxisExclusive)
+
Copyright (c) 2020 ARM Limited.
+
void IgnoreUnused(Ts &&...)
+
virtual IType Get() const =0
+ +
unsigned int GetUnsignedAxis(const unsigned int inputDimension, const int axis)
+
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:33
+ +
ArgMinMaxFunction
Definition: Types.hpp:71
+ +
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:92
+ + +
+
+ + + + -- cgit v1.2.1