ArmNN
 24.08
RefLstmWorkload.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2022 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  void ExecuteAsync(ExecutionData& executionData) override;
23 
24 private:
25  void Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const;
26  std::unique_ptr<ScopedTensorHandle> m_InputToInputWeightsTensor;
27  std::unique_ptr<ScopedTensorHandle> m_InputToForgetWeightsTensor;
28  std::unique_ptr<ScopedTensorHandle> m_InputToCellWeightsTensor;
29  std::unique_ptr<ScopedTensorHandle> m_InputToOutputWeightsTensor;
30  std::unique_ptr<ScopedTensorHandle> m_RecurrentToInputWeightsTensor;
31  std::unique_ptr<ScopedTensorHandle> m_RecurrentToForgetWeightsTensor;
32  std::unique_ptr<ScopedTensorHandle> m_RecurrentToCellWeightsTensor;
33  std::unique_ptr<ScopedTensorHandle> m_RecurrentToOutputWeightsTensor;
34  std::unique_ptr<ScopedTensorHandle> m_CellToInputWeightsTensor;
35  std::unique_ptr<ScopedTensorHandle> m_CellToForgetWeightsTensor;
36  std::unique_ptr<ScopedTensorHandle> m_CellToOutputWeightsTensor;
37  std::unique_ptr<ScopedTensorHandle> m_InputGateBiasTensor;
38  std::unique_ptr<ScopedTensorHandle> m_ForgetGateBiasTensor;
39  std::unique_ptr<ScopedTensorHandle> m_CellBiasTensor;
40  std::unique_ptr<ScopedTensorHandle> m_OutputGateBiasTensor;
41  std::unique_ptr<ScopedTensorHandle> m_ProjectionWeightsTensor;
42  std::unique_ptr<ScopedTensorHandle> m_ProjectionBiasTensor;
43  std::unique_ptr<ScopedTensorHandle> m_InputLayerNormWeights;
44  std::unique_ptr<ScopedTensorHandle> m_ForgetLayerNormWeights;
45  std::unique_ptr<ScopedTensorHandle> m_CellLayerNormWeights;
46  std::unique_ptr<ScopedTensorHandle> m_OutputLayerNormWeights;
47 
48  float m_LayerNormEpsilon = static_cast<float>(1e-8);
49 };
50 
51 } //namespace armnn
WorkloadData.hpp
TypesUtils.hpp
armnn::RefLstmWorkload
Definition: RefLstmWorkload.hpp:16
armnn::RefLstmWorkload::ExecuteAsync
void ExecuteAsync(ExecutionData &executionData) override
Definition: RefLstmWorkload.cpp:47
armnn::RefLstmWorkload::RefLstmWorkload
RefLstmWorkload(const LstmQueueDescriptor &descriptor, const WorkloadInfo &info)
Definition: RefLstmWorkload.cpp:17
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
armnn::BoostLogSeverityMapping::info
@ info
armnn::LstmQueueDescriptor
Definition: WorkloadData.hpp:400
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
RefBaseWorkload.hpp
armnn::RefBaseWorkload
Definition: RefBaseWorkload.hpp:13
armnn::RefLstmWorkload::Execute
void Execute() const override
Definition: RefLstmWorkload.cpp:42
armnn::experimental::ExecutionData
Definition: ExecutionData.hpp:14