ArmNN
 20.02
RefLstmWorkload.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <armnn/TypesUtils.hpp>
9 
12 
13 namespace armnn
14 {
15 
16 class RefLstmWorkload : public BaseWorkload<LstmQueueDescriptor>
17 {
18 public:
19  explicit RefLstmWorkload(const LstmQueueDescriptor& descriptor, const WorkloadInfo& info);
20 
21  virtual void Execute() const override;
22 
23 private:
24  std::unique_ptr<ScopedCpuTensorHandle> m_InputToInputWeightsTensor;
25  std::unique_ptr<ScopedCpuTensorHandle> m_InputToForgetWeightsTensor;
26  std::unique_ptr<ScopedCpuTensorHandle> m_InputToCellWeightsTensor;
27  std::unique_ptr<ScopedCpuTensorHandle> m_InputToOutputWeightsTensor;
28  std::unique_ptr<ScopedCpuTensorHandle> m_RecurrentToInputWeightsTensor;
29  std::unique_ptr<ScopedCpuTensorHandle> m_RecurrentToForgetWeightsTensor;
30  std::unique_ptr<ScopedCpuTensorHandle> m_RecurrentToCellWeightsTensor;
31  std::unique_ptr<ScopedCpuTensorHandle> m_RecurrentToOutputWeightsTensor;
32  std::unique_ptr<ScopedCpuTensorHandle> m_CellToInputWeightsTensor;
33  std::unique_ptr<ScopedCpuTensorHandle> m_CellToForgetWeightsTensor;
34  std::unique_ptr<ScopedCpuTensorHandle> m_CellToOutputWeightsTensor;
35  std::unique_ptr<ScopedCpuTensorHandle> m_InputGateBiasTensor;
36  std::unique_ptr<ScopedCpuTensorHandle> m_ForgetGateBiasTensor;
37  std::unique_ptr<ScopedCpuTensorHandle> m_CellBiasTensor;
38  std::unique_ptr<ScopedCpuTensorHandle> m_OutputGateBiasTensor;
39  std::unique_ptr<ScopedCpuTensorHandle> m_ProjectionWeightsTensor;
40  std::unique_ptr<ScopedCpuTensorHandle> m_ProjectionBiasTensor;
41  std::unique_ptr<ScopedCpuTensorHandle> m_InputLayerNormWeights;
42  std::unique_ptr<ScopedCpuTensorHandle> m_ForgetLayerNormWeights;
43  std::unique_ptr<ScopedCpuTensorHandle> m_CellLayerNormWeights;
44  std::unique_ptr<ScopedCpuTensorHandle> m_OutputLayerNormWeights;
45 
46  float m_LayerNormEpsilon = static_cast<float>(1e-8);
47 };
48 
49 } //namespace armnn
RefLstmWorkload(const LstmQueueDescriptor &descriptor, const WorkloadInfo &info)
Copyright (c) 2020 ARM Limited.
virtual void Execute() const override
Contains information about inputs and outputs to a layer.