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 --- ..._2workloads_2_fully_connected_8cpp_source.xhtml | 122 +++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 20.02/backends_2reference_2workloads_2_fully_connected_8cpp_source.xhtml (limited to '20.02/backends_2reference_2workloads_2_fully_connected_8cpp_source.xhtml') diff --git a/20.02/backends_2reference_2workloads_2_fully_connected_8cpp_source.xhtml b/20.02/backends_2reference_2workloads_2_fully_connected_8cpp_source.xhtml new file mode 100644 index 0000000000..ae50cb3529 --- /dev/null +++ b/20.02/backends_2reference_2workloads_2_fully_connected_8cpp_source.xhtml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + +ArmNN: src/backends/reference/workloads/FullyConnected.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
FullyConnected.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "FullyConnected.hpp"
7 
8 #include "RefWorkloadUtils.hpp"
9 
10 #include <boost/assert.hpp>
11 
12 namespace armnn
13 {
14 
15 void FullyConnected(const TensorShape& rInputShape,
16  Decoder<float>& rInputDecoder,
17  const TensorShape& rOutputShape,
18  Encoder<float>& rOutputEncoder,
19  Decoder<float>& rWeightDecoder,
20  Decoder<float>& rBiasDecoder,
21  const bool biasEnabled,
22  const unsigned int K,
23  const bool transposeWeights)
24 {
25  // Perform FullyConnected implementation
26  unsigned int outputSize = rOutputShape[1];
27 
28  for (unsigned int n = 0; n < rInputShape[0]; n++)
29  {
30  for (unsigned int channelOutput = 0; channelOutput < outputSize; channelOutput++)
31  {
32  float outval = 0.f;
33 
34  for (unsigned int channelInput = 0; channelInput < K; channelInput++)
35  {
36  float weight;
37  if (transposeWeights)
38  {
39  rWeightDecoder[channelOutput * K + channelInput];
40  weight = rWeightDecoder.Get();
41  }
42  else
43  {
44  rWeightDecoder[channelInput * outputSize + channelOutput];
45  weight = rWeightDecoder.Get();
46  }
47 
48  rInputDecoder[n * K + channelInput];
49  outval += weight * rInputDecoder.Get();
50  }
51 
52  if (biasEnabled)
53  {
54  rBiasDecoder[channelOutput];
55  outval += rBiasDecoder.Get();
56  }
57 
58  rOutputEncoder[n * outputSize + channelOutput];
59  rOutputEncoder.Set(outval);
60  }
61  }
62 }
63 
64 } //namespace armnn
+
virtual void Set(IType right)=0
+ +
void FullyConnected(const TensorShape &rInputShape, Decoder< float > &rInputDecoder, const TensorShape &rOutputShape, Encoder< float > &rOutputEncoder, Decoder< float > &rWeightDecoder, Decoder< float > &rBiasDecoder, const bool biasEnabled, const unsigned int K, const bool transposeWeights)
Performs a matrix multiplication and optionally adds a bias.
+
Copyright (c) 2020 ARM Limited.
+ +
virtual IType Get() const =0
+ + +
+
+ + + + -- cgit v1.2.1