ArmNN
 21.11
RefSoftmaxWorkload.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 "RefSoftmaxWorkload.hpp"
7 
8 #include "Decoders.hpp"
9 #include "Encoders.hpp"
10 #include "RefWorkloadUtils.hpp"
11 #include "Softmax.hpp"
12 
13 #include "Profiling.hpp"
14 
15 #include <vector>
16 
17 namespace armnn
18 {
19 
21 {
23 }
24 
26 {
27  Execute(workingMemDescriptor.m_Inputs, workingMemDescriptor.m_Outputs);
28 }
29 
30 void RefSoftmaxWorkload::Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const
31 {
32  ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefSoftmaxWorkload_Execute");
33 
34  const TensorInfo &inputTensorInfo = GetTensorInfo(inputs[0]);
35 
36  std::unique_ptr<Decoder<float>> decoderPtr = MakeDecoder<float>(inputTensorInfo, inputs[0]->Map());
37  Decoder<float> &decoder = *decoderPtr;
38 
39  const TensorInfo &outputTensorInfo = GetTensorInfo(outputs[0]);
40 
41  std::unique_ptr<Encoder<float>> encoderPtr = MakeEncoder<float>(outputTensorInfo, outputs[0]->Map());
42  Encoder<float> &encoder = *encoderPtr;
43 
44  Softmax(decoder,
45  encoder,
46  inputTensorInfo,
49 }
50 } //namespace armnn
int m_Axis
Scalar, defaulted to the last index (-1), specifying the dimension the activation will be performed o...
CPU Execution: Reference C++ kernels.
float m_Beta
Exponentiation value.
Copyright (c) 2021 ARM Limited and Contributors.
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:220
void ExecuteAsync(WorkingMemDescriptor &workingMemDescriptor) override
std::vector< ITensorHandle * > m_Outputs
std::vector< ITensorHandle * > m_Inputs
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
void Execute() const override