blob: f4d89742262f096df9a447c4d850b408240314b8 [file] [log] [blame]
telsoa01c577f2c2018-08-31 09:22:23 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa01c577f2c2018-08-31 09:22:23 +01004//
5
arovir019e53a352018-08-31 15:26:35 +01006#include "ClLstmFloatWorkload.hpp"
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +00007#include <cl/ClTensorHandle.hpp>
8#include <backendsCommon/CpuTensorHandle.hpp>
9#include <cl/ClLayerSupport.hpp>
10#include <aclCommon/ArmComputeTensorUtils.hpp>
Matthew Bentham14e46692018-09-20 15:35:30 +010011
12#include <arm_compute/runtime/CL/functions/CLLSTMLayer.h>
13
14#include "ClWorkloadUtils.hpp"
telsoa01c577f2c2018-08-31 09:22:23 +010015
16namespace armnn
17{
18using namespace armcomputetensorutils;
19
arovir019e53a352018-08-31 15:26:35 +010020ClLstmFloatWorkload::ClLstmFloatWorkload(const LstmQueueDescriptor &descriptor, const WorkloadInfo &info)
telsoa01c577f2c2018-08-31 09:22:23 +010021 : FloatWorkload<LstmQueueDescriptor>(descriptor, info)
22{
23 arm_compute::LSTMParams<arm_compute::ICLTensor> lstm_param;
24
25 // Basic parameters
26 m_InputToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
27 BuildArmComputeTensor(*m_InputToForgetWeightsTensor, m_Data.m_InputToForgetWeights->GetTensorInfo());
28
29 m_InputToCellWeightsTensor = std::make_unique<arm_compute::CLTensor>();
30 BuildArmComputeTensor(*m_InputToCellWeightsTensor, m_Data.m_InputToCellWeights->GetTensorInfo());
31
32 m_InputToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
33 BuildArmComputeTensor(*m_InputToOutputWeightsTensor, m_Data.m_InputToOutputWeights->GetTensorInfo());
34
35 m_RecurrentToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
36 BuildArmComputeTensor(*m_RecurrentToForgetWeightsTensor, m_Data.m_RecurrentToForgetWeights->GetTensorInfo());
37
38 m_RecurrentToCellWeightsTensor = std::make_unique<arm_compute::CLTensor>();
39 BuildArmComputeTensor(*m_RecurrentToCellWeightsTensor, m_Data.m_RecurrentToCellWeights->GetTensorInfo());
40
41 m_RecurrentToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
42 BuildArmComputeTensor(*m_RecurrentToOutputWeightsTensor, m_Data.m_RecurrentToOutputWeights->GetTensorInfo());
43
44 m_ForgetGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
45 BuildArmComputeTensor(*m_ForgetGateBiasTensor, m_Data.m_ForgetGateBias->GetTensorInfo());
46
47 m_CellBiasTensor = std::make_unique<arm_compute::CLTensor>();
48 BuildArmComputeTensor(*m_CellBiasTensor, m_Data.m_CellBias->GetTensorInfo());
49
50 m_OutputGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
51 BuildArmComputeTensor(*m_OutputGateBiasTensor, m_Data.m_OutputGateBias->GetTensorInfo());
52
53 // for future reference: check the AndroidNN API for the logic here
54 if (!m_Data.m_Parameters.m_CifgEnabled)
55 {
56 m_InputToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
57 BuildArmComputeTensor(*m_InputToInputWeightsTensor, m_Data.m_InputToInputWeights->GetTensorInfo());
58
59 m_RecurrentToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
60 BuildArmComputeTensor(*m_RecurrentToInputWeightsTensor, m_Data.m_RecurrentToInputWeights->GetTensorInfo());
61
62 m_CellToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
63 if (m_Data.m_CellToInputWeights != nullptr)
64 {
65 BuildArmComputeTensor(*m_CellToInputWeightsTensor, m_Data.m_CellToInputWeights->GetTensorInfo());
66 }
67
68 m_InputGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
69 BuildArmComputeTensor(*m_InputGateBiasTensor, m_Data.m_InputGateBias->GetTensorInfo());
70
71 lstm_param.set_cifg_params(m_InputToInputWeightsTensor.get(),
72 m_RecurrentToInputWeightsTensor.get(),
73 m_Data.m_CellToInputWeights != nullptr ? m_CellToInputWeightsTensor.get() : nullptr,
74 m_InputGateBiasTensor.get());
75 }
76
77 if (m_Data.m_Parameters.m_ProjectionEnabled)
78 {
79 m_ProjectionWeightsTensor = std::make_unique<arm_compute::CLTensor>();
80 BuildArmComputeTensor(*m_ProjectionWeightsTensor, m_Data.m_ProjectionWeights->GetTensorInfo());
81
82 m_ProjectionBiasTensor = std::make_unique<arm_compute::CLTensor>();
83 if (m_Data.m_ProjectionBias != nullptr)
84 {
85 BuildArmComputeTensor(*m_ProjectionBiasTensor, m_Data.m_ProjectionBias->GetTensorInfo());
86 }
87
88 lstm_param.set_projection_params(m_ProjectionWeightsTensor.get(),
89 m_Data.m_ProjectionBias != nullptr ? m_ProjectionBiasTensor.get() : nullptr);
90 }
91
92 if (m_Data.m_Parameters.m_PeepholeEnabled)
93 {
94 m_CellToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
95 BuildArmComputeTensor(*m_CellToForgetWeightsTensor, m_Data.m_CellToForgetWeights->GetTensorInfo());
96
97 m_CellToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
98 BuildArmComputeTensor(*m_CellToOutputWeightsTensor, m_Data.m_CellToOutputWeights->GetTensorInfo());
99
100 lstm_param.set_peephole_params(m_CellToForgetWeightsTensor.get(), m_CellToOutputWeightsTensor.get());
101 }
102
103 const arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
104 const arm_compute::ICLTensor& output_state_in = static_cast<IClTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
105 const arm_compute::ICLTensor& cell_state_in = static_cast<IClTensorHandle*>(m_Data.m_Inputs[2])->GetTensor();
106
107 arm_compute::ICLTensor& output_state_out = static_cast<IClTensorHandle*>(m_Data.m_Outputs[1])->GetTensor();
108 arm_compute::ICLTensor& cell_state_out = static_cast<IClTensorHandle*>(m_Data.m_Outputs[2])->GetTensor();
109 arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[3])->GetTensor();
110
111 // Get the batch_size and the num_units from the cellStateIn dimensions
112 const TensorInfo& inputTensorInfo = info.m_InputTensorInfos[2];
113 const unsigned int batch_size = boost::numeric_cast<unsigned int>(inputTensorInfo.GetShape()[0]);
114 const unsigned int num_units = boost::numeric_cast<unsigned int>(inputTensorInfo.GetShape()[1]);
115
116 m_ScratchBuffer = std::make_unique<arm_compute::CLTensor>();
117 if (m_Data.m_Parameters.m_CifgEnabled)
118 {
Matteo Martincigha65b7ae2018-11-14 12:39:55 +0000119 // 2D tensor with dimensions [num_units * 3, batch_size] with CIFG
120 armnn::TensorInfo scratchBuffer1({ batch_size, num_units * 3 }, DataType::Float32);
telsoa01c577f2c2018-08-31 09:22:23 +0100121 BuildArmComputeTensor(*m_ScratchBuffer, scratchBuffer1);
122 }
123 else
124 {
Matteo Martincigha65b7ae2018-11-14 12:39:55 +0000125 // scratch_buffer [num_units * 4, batch_size] without CIFG
126 armnn::TensorInfo scratchBuffer2({ batch_size, num_units * 4 }, DataType::Float32);
telsoa01c577f2c2018-08-31 09:22:23 +0100127 BuildArmComputeTensor(*m_ScratchBuffer, scratchBuffer2);
128 }
129
130 float cell_threshold = m_Data.m_Parameters.m_ClippingThresCell;
131 float projection_threshold = m_Data.m_Parameters.m_ClippingThresProj;
132
133 // for preparing the object for the class ActivationLayerInfo, we need to consider 5 situations
134 arm_compute::ActivationLayerInfo activationLayerInfo;
135 if (m_Data.m_Parameters.m_ActivationFunc == 0)
136 {
137 // no activation, do nothing
138 }
139 else if (m_Data.m_Parameters.m_ActivationFunc == 1)
140 {
141 activationLayerInfo = arm_compute::ActivationLayerInfo(
142 arm_compute::ActivationLayerInfo::ActivationFunction::RELU);
143 }
144 else if (m_Data.m_Parameters.m_ActivationFunc == 3)
145 {
146 activationLayerInfo = arm_compute::ActivationLayerInfo(
147 arm_compute::ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.0);
148 }
149 else if (m_Data.m_Parameters.m_ActivationFunc == 4)
150 {
151 activationLayerInfo = arm_compute::ActivationLayerInfo(
152 arm_compute::ActivationLayerInfo::ActivationFunction::TANH, 1.0, 1.0);
153 }
154 else if (m_Data.m_Parameters.m_ActivationFunc == 6)
155 {
156 activationLayerInfo = arm_compute::ActivationLayerInfo(
157 arm_compute::ActivationLayerInfo::ActivationFunction::LOGISTIC);
158 }
159 else
160 {
161 throw armnn::Exception("Wrong Type of Activation Function!");
162 }
163
164
165 m_LstmLayer.configure(&input, m_InputToForgetWeightsTensor.get(), m_InputToCellWeightsTensor.get(),
166 m_InputToOutputWeightsTensor.get(), m_RecurrentToForgetWeightsTensor.get(),
167 m_RecurrentToCellWeightsTensor.get(), m_RecurrentToOutputWeightsTensor.get(),
168 m_ForgetGateBiasTensor.get(), m_CellBiasTensor.get(), m_OutputGateBiasTensor.get(),
169 &output_state_in, &cell_state_in, m_ScratchBuffer.get(), &output_state_out,
170 &cell_state_out, &output, lstm_param, activationLayerInfo,
171 cell_threshold, projection_threshold);
172
173 armcomputetensorutils::InitialiseArmComputeTensorEmpty(*m_ScratchBuffer);
174
Matthew Bentham785df502018-09-21 10:29:58 +0100175 InitializeArmComputeClTensorData(*m_InputToForgetWeightsTensor, m_Data.m_InputToForgetWeights);
176 InitializeArmComputeClTensorData(*m_InputToCellWeightsTensor, m_Data.m_InputToCellWeights);
177 InitializeArmComputeClTensorData(*m_InputToOutputWeightsTensor, m_Data.m_InputToOutputWeights);
178 InitializeArmComputeClTensorData(*m_RecurrentToForgetWeightsTensor, m_Data.m_RecurrentToForgetWeights);
179 InitializeArmComputeClTensorData(*m_RecurrentToCellWeightsTensor, m_Data.m_RecurrentToCellWeights);
180 InitializeArmComputeClTensorData(*m_RecurrentToOutputWeightsTensor, m_Data.m_RecurrentToOutputWeights);
181 InitializeArmComputeClTensorData(*m_ForgetGateBiasTensor, m_Data.m_ForgetGateBias);
182 InitializeArmComputeClTensorData(*m_CellBiasTensor, m_Data.m_CellBias);
183 InitializeArmComputeClTensorData(*m_OutputGateBiasTensor, m_Data.m_OutputGateBias);
telsoa01c577f2c2018-08-31 09:22:23 +0100184
185 if (!m_Data.m_Parameters.m_CifgEnabled)
186 {
Matthew Bentham785df502018-09-21 10:29:58 +0100187 InitializeArmComputeClTensorData(*m_InputToInputWeightsTensor, m_Data.m_InputToInputWeights);
188 InitializeArmComputeClTensorData(*m_RecurrentToInputWeightsTensor, m_Data.m_RecurrentToInputWeights);
telsoa01c577f2c2018-08-31 09:22:23 +0100189 if (m_Data.m_CellToInputWeights != nullptr)
190 {
Matthew Bentham785df502018-09-21 10:29:58 +0100191 InitializeArmComputeClTensorData(*m_CellToInputWeightsTensor, m_Data.m_CellToInputWeights);
telsoa01c577f2c2018-08-31 09:22:23 +0100192 }
Matthew Bentham785df502018-09-21 10:29:58 +0100193 InitializeArmComputeClTensorData(*m_InputGateBiasTensor, m_Data.m_InputGateBias);
telsoa01c577f2c2018-08-31 09:22:23 +0100194 }
195
196 if (m_Data.m_Parameters.m_ProjectionEnabled)
197 {
Matthew Bentham785df502018-09-21 10:29:58 +0100198 InitializeArmComputeClTensorData(*m_ProjectionWeightsTensor, m_Data.m_ProjectionWeights);
telsoa01c577f2c2018-08-31 09:22:23 +0100199 if (m_Data.m_ProjectionBias != nullptr)
200 {
Matthew Bentham785df502018-09-21 10:29:58 +0100201 InitializeArmComputeClTensorData(*m_ProjectionBiasTensor, m_Data.m_ProjectionBias);
telsoa01c577f2c2018-08-31 09:22:23 +0100202 }
203 }
204
205 if (m_Data.m_Parameters.m_PeepholeEnabled)
206 {
Matthew Bentham785df502018-09-21 10:29:58 +0100207 InitializeArmComputeClTensorData(*m_CellToForgetWeightsTensor, m_Data.m_CellToForgetWeights);
208 InitializeArmComputeClTensorData(*m_CellToOutputWeightsTensor, m_Data.m_CellToOutputWeights);
telsoa01c577f2c2018-08-31 09:22:23 +0100209 }
210
211 // Force Compute Library to perform the necessary copying and reshaping, after which
212 // delete all the input tensors that will no longer be needed
213 m_LstmLayer.prepare();
214 FreeUnusedTensors();
215}
216
arovir019e53a352018-08-31 15:26:35 +0100217void ClLstmFloatWorkload::Execute() const
telsoa01c577f2c2018-08-31 09:22:23 +0100218{
Aron Virginas-Tar7bc8c9f2018-10-19 16:58:08 +0100219 ARMNN_SCOPED_PROFILING_EVENT_CL("ClLstmFloatWorkload_Execute");
Aron Virginas-Tara8e06ed2018-10-19 16:46:15 +0100220 RunClFunction(m_LstmLayer, CHECK_LOCATION());
telsoa01c577f2c2018-08-31 09:22:23 +0100221}
222
arovir019e53a352018-08-31 15:26:35 +0100223arm_compute::Status ClLstmFloatWorkloadValidate(const TensorInfo& input, const TensorInfo& outputStateIn,
224 const TensorInfo& cellStateIn, const TensorInfo& scratchBuffer,
225 const TensorInfo& outputStateOut, const TensorInfo& cellStateOut,
226 const TensorInfo& output, const LstmDescriptor& descriptor,
227 const TensorInfo& inputToForgetWeights,
228 const TensorInfo& inputToCellWeights,
229 const TensorInfo& inputToOutputWeights,
230 const TensorInfo& recurrentToForgetWeights,
231 const TensorInfo& recurrentToCellWeights,
232 const TensorInfo& recurrentToOutputWeights,
233 const TensorInfo& forgetGateBias, const TensorInfo& cellBias,
234 const TensorInfo& outputGateBias,
235 const TensorInfo* inputToInputWeights,
236 const TensorInfo* recurrentToInputWeights,
237 const TensorInfo* cellToInputWeights,
238 const TensorInfo* inputGateBias,
239 const TensorInfo* projectionWeights,
240 const TensorInfo* projectionBias,
241 const TensorInfo* cellToForgetWeights,
242 const TensorInfo* cellToOutputWeights)
telsoa01c577f2c2018-08-31 09:22:23 +0100243{
244 arm_compute::LSTMParams<arm_compute::ITensorInfo> lstm_params_info;
245
246 // The inputs and the outputs
247 const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input);
248 const arm_compute::TensorInfo aclOutputStateInInfo = BuildArmComputeTensorInfo(outputStateIn);
249 const arm_compute::TensorInfo aclCellStateInInfo = BuildArmComputeTensorInfo(cellStateIn);
250 const arm_compute::TensorInfo aclScratchBufferInfo = BuildArmComputeTensorInfo(scratchBuffer);
251 const arm_compute::TensorInfo aclOutputStateOutInfo = BuildArmComputeTensorInfo(outputStateOut);
252 const arm_compute::TensorInfo aclCellStateOutInfo = BuildArmComputeTensorInfo(cellStateOut);
253 const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output);
254
255 // Basic parameters
256 const arm_compute::TensorInfo aclInputToForgetWeightsInfo = BuildArmComputeTensorInfo(inputToForgetWeights);
257 const arm_compute::TensorInfo aclInputToCellWeightsInfo = BuildArmComputeTensorInfo(inputToCellWeights);
258 const arm_compute::TensorInfo aclInputToOutputWeightsInfo = BuildArmComputeTensorInfo(inputToOutputWeights);
259 const arm_compute::TensorInfo aclRecurrentToForgetWeightsInfo
260 = BuildArmComputeTensorInfo(recurrentToForgetWeights);
261 const arm_compute::TensorInfo aclRecurrentToCellWeightsInfo
262 = BuildArmComputeTensorInfo(recurrentToCellWeights);
263 const arm_compute::TensorInfo aclRecurrentToOutputWeightsInfo
264 = BuildArmComputeTensorInfo(recurrentToOutputWeights);
265 const arm_compute::TensorInfo aclForgetGateBiasInfo = BuildArmComputeTensorInfo(forgetGateBias);
266 const arm_compute::TensorInfo aclCellBiasInfo = BuildArmComputeTensorInfo(cellBias);
267 const arm_compute::TensorInfo aclOutputGateBiasInfo = BuildArmComputeTensorInfo(outputGateBias);
268
269 arm_compute::TensorInfo aclInputToInputWeightsInfo;
270 arm_compute::TensorInfo aclRecurrentToInputWeightsInfo;
271 arm_compute::TensorInfo aclCellToInputWeightsInfo;
272 arm_compute::TensorInfo aclInputGateBiasInfo;
273 arm_compute::TensorInfo aclProjectionWeightsInfo;
274 arm_compute::TensorInfo aclProjectionBiasInfo;
275 arm_compute::TensorInfo aclCellToForgetWeightsInfo;
276 arm_compute::TensorInfo aclCellToOutputWeightsInfo;
277
278 if (!descriptor.m_CifgEnabled)
279 {
280 armnn::TensorInfo inputToInputWInfo = *inputToInputWeights;
281 aclInputToInputWeightsInfo = BuildArmComputeTensorInfo(inputToInputWInfo);
282 armnn::TensorInfo recurrentToInputWInfo = *recurrentToInputWeights;
283 aclRecurrentToInputWeightsInfo = BuildArmComputeTensorInfo(recurrentToInputWInfo);
284
285 if (cellToInputWeights != nullptr)
286 {
287 armnn::TensorInfo cellToInputWInfo = *cellToInputWeights;
288 aclCellToInputWeightsInfo = BuildArmComputeTensorInfo(cellToInputWInfo);
289 }
290 armnn::TensorInfo inputGateBiasInfo = *inputGateBias;
291 aclInputGateBiasInfo = BuildArmComputeTensorInfo(inputGateBiasInfo);
292 lstm_params_info.set_cifg_params(&aclInputToInputWeightsInfo, &aclRecurrentToInputWeightsInfo,
293 cellToInputWeights != nullptr ? &aclCellToInputWeightsInfo: nullptr,
294 &aclInputGateBiasInfo);
295 }
296
297 if (descriptor.m_ProjectionEnabled)
298 {
299 const armnn::TensorInfo& projectionWInfo = *projectionWeights;
300 aclProjectionWeightsInfo = BuildArmComputeTensorInfo(projectionWInfo);
301
302 if (projectionBias != nullptr)
303 {
304 const armnn::TensorInfo& projectionBiasInfo = *projectionBias;
305 aclProjectionBiasInfo = BuildArmComputeTensorInfo(projectionBiasInfo);
306 }
307 lstm_params_info.set_projection_params(&aclProjectionWeightsInfo,
308 projectionBias != nullptr ? &aclProjectionBiasInfo: nullptr);
309 }
310
311 if (descriptor.m_PeepholeEnabled)
312 {
313 const armnn::TensorInfo& cellToForgetWInfo = *cellToForgetWeights;
314 aclCellToForgetWeightsInfo = BuildArmComputeTensorInfo(cellToForgetWInfo);
315 const armnn::TensorInfo& cellToOutputWInfo = *cellToOutputWeights;
316 aclCellToOutputWeightsInfo = BuildArmComputeTensorInfo(cellToOutputWInfo);
317 lstm_params_info.set_peephole_params(&aclCellToForgetWeightsInfo, &aclCellToOutputWeightsInfo);
318 }
319
320 float cell_threshold = descriptor.m_ClippingThresCell;
321 float projection_threshold = descriptor.m_ClippingThresProj;
322
323 // for preparing the object for the class ActivationLayerInfo, we need to consider 5 situations
324 arm_compute::ActivationLayerInfo activationLayerInfo;
325 if (descriptor.m_ActivationFunc == 0)
326 {
327 // no activation, do nothing
328 }
329 else if (descriptor.m_ActivationFunc == 1)
330 {
331 activationLayerInfo = arm_compute::ActivationLayerInfo(
332 arm_compute::ActivationLayerInfo::ActivationFunction::RELU);
333 }
334 else if (descriptor.m_ActivationFunc == 3)
335 {
336 activationLayerInfo = arm_compute::ActivationLayerInfo(
337 arm_compute::ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.0);
338 }
339 else if (descriptor.m_ActivationFunc == 4)
340 {
341 activationLayerInfo = arm_compute::ActivationLayerInfo(
342 arm_compute::ActivationLayerInfo::ActivationFunction::TANH, 1.0, 1.0);
343 }
344 else if (descriptor.m_ActivationFunc == 6)
345 {
346 activationLayerInfo = arm_compute::ActivationLayerInfo(
347 arm_compute::ActivationLayerInfo::ActivationFunction::LOGISTIC);
348 }
349 else
350 {
351 throw armnn::Exception("Wrong Type of Activation Function!");
352 }
353
354 return arm_compute::CLLSTMLayer::validate(&aclInputInfo, &aclInputToForgetWeightsInfo,
355 &aclInputToCellWeightsInfo,
356 &aclInputToOutputWeightsInfo,
357 &aclRecurrentToForgetWeightsInfo,
358 &aclRecurrentToCellWeightsInfo,
359 &aclRecurrentToOutputWeightsInfo,
360 &aclForgetGateBiasInfo,
361 &aclCellBiasInfo,
362 &aclOutputGateBiasInfo,
363 &aclOutputStateInInfo, &aclCellStateInInfo,
364 &aclScratchBufferInfo, &aclOutputStateOutInfo,
365 &aclCellStateOutInfo, &aclOutputInfo,
366 lstm_params_info, activationLayerInfo,
367 cell_threshold, projection_threshold);
368}
369
arovir019e53a352018-08-31 15:26:35 +0100370void ClLstmFloatWorkload::FreeUnusedTensors()
telsoa01c577f2c2018-08-31 09:22:23 +0100371{
372 FreeTensorIfUnused(m_InputToInputWeightsTensor);
373 FreeTensorIfUnused(m_InputToForgetWeightsTensor);
374 FreeTensorIfUnused(m_InputToCellWeightsTensor);
375 FreeTensorIfUnused(m_InputToOutputWeightsTensor);
376 FreeTensorIfUnused(m_RecurrentToInputWeightsTensor);
377 FreeTensorIfUnused(m_RecurrentToForgetWeightsTensor);
378 FreeTensorIfUnused(m_RecurrentToCellWeightsTensor);
379 FreeTensorIfUnused(m_RecurrentToOutputWeightsTensor);
380 FreeTensorIfUnused(m_CellToInputWeightsTensor);
381 FreeTensorIfUnused(m_CellToForgetWeightsTensor);
382 FreeTensorIfUnused(m_CellToOutputWeightsTensor);
383 FreeTensorIfUnused(m_InputGateBiasTensor);
384 FreeTensorIfUnused(m_ForgetGateBiasTensor);
385 FreeTensorIfUnused(m_CellBiasTensor);
386 FreeTensorIfUnused(m_OutputGateBiasTensor);
387 FreeTensorIfUnused(m_ProjectionWeightsTensor);
388 FreeTensorIfUnused(m_ProjectionBiasTensor);
389 FreeTensorIfUnused(m_ScratchBuffer);
390}
391
392} //namespace armnn