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