19 const bool biasEnabled,
21 const bool transposeWeights)
24 unsigned int outputSize = rOutputShape[1];
26 for (
unsigned int n = 0; n < rInputShape[0]; n++)
28 for (
unsigned int channelOutput = 0; channelOutput < outputSize; channelOutput++)
32 for (
unsigned int channelInput = 0; channelInput < K; channelInput++)
37 rWeightDecoder[channelOutput * K + channelInput];
38 weight = rWeightDecoder.
Get();
42 rWeightDecoder[channelInput * outputSize + channelOutput];
43 weight = rWeightDecoder.
Get();
46 rInputDecoder[n * K + channelInput];
47 outval += weight * rInputDecoder.
Get();
52 rBiasDecoder[channelOutput];
53 outval += rBiasDecoder.
Get();
56 rOutputEncoder[n * outputSize + channelOutput];
57 rOutputEncoder.
Set(outval);
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