blob: 6feffbcb004e1ac1eb4892d6f08ac846c4e5bf70 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
#include <armnn/TypesUtils.hpp>
#include <backendsCommon/Workload.hpp>
#include <backendsCommon/WorkloadData.hpp>
namespace armnn
{
class RefLstmWorkload : public BaseWorkload<LstmQueueDescriptor>
{
public:
explicit RefLstmWorkload(const LstmQueueDescriptor& descriptor, const WorkloadInfo& info);
void Execute() const override;
void ExecuteAsync(WorkingMemDescriptor& workingMemDescriptor) override;
private:
void Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const;
std::unique_ptr<ScopedTensorHandle> m_InputToInputWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_InputToForgetWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_InputToCellWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_InputToOutputWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_RecurrentToInputWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_RecurrentToForgetWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_RecurrentToCellWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_RecurrentToOutputWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_CellToInputWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_CellToForgetWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_CellToOutputWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_InputGateBiasTensor;
std::unique_ptr<ScopedTensorHandle> m_ForgetGateBiasTensor;
std::unique_ptr<ScopedTensorHandle> m_CellBiasTensor;
std::unique_ptr<ScopedTensorHandle> m_OutputGateBiasTensor;
std::unique_ptr<ScopedTensorHandle> m_ProjectionWeightsTensor;
std::unique_ptr<ScopedTensorHandle> m_ProjectionBiasTensor;
std::unique_ptr<ScopedTensorHandle> m_InputLayerNormWeights;
std::unique_ptr<ScopedTensorHandle> m_ForgetLayerNormWeights;
std::unique_ptr<ScopedTensorHandle> m_CellLayerNormWeights;
std::unique_ptr<ScopedTensorHandle> m_OutputLayerNormWeights;
float m_LayerNormEpsilon = static_cast<float>(1e-8);
};
} //namespace armnn
|