Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 1 | /* |
John Kesapides | cafec8f | 2019-02-19 15:53:59 +0000 | [diff] [blame] | 2 | * Copyright (c) 2018-2019 ARM Limited. |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
Michalis Spyrou | f464337 | 2019-11-29 16:17:13 +0000 | [diff] [blame] | 24 | #ifndef ARM_COMPUTE_CLLSTMLAYER_H |
| 25 | #define ARM_COMPUTE_CLLSTMLAYER_H |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 26 | |
| 27 | #include "arm_compute/runtime/IFunction.h" |
| 28 | |
| 29 | #include "arm_compute/core/CL/kernels/CLActivationLayerKernel.h" |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 30 | #include "arm_compute/core/CL/kernels/CLCopyKernel.h" |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 31 | #include "arm_compute/core/CL/kernels/CLElementwiseOperationKernel.h" |
Georgios Pinitas | dbfc2dc | 2019-04-02 12:51:21 +0100 | [diff] [blame] | 32 | #include "arm_compute/core/CL/kernels/CLMemsetKernel.h" |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 33 | #include "arm_compute/core/CL/kernels/CLPixelWiseMultiplicationKernel.h" |
John Kesapides | cafec8f | 2019-02-19 15:53:59 +0000 | [diff] [blame] | 34 | #include "arm_compute/core/CL/kernels/CLWidthConcatenate2TensorsKernel.h" |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 35 | #include "arm_compute/core/Types.h" |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 36 | #include "arm_compute/runtime/CL/CLTensor.h" |
Georgios Pinitas | 09f2497 | 2019-05-17 18:14:40 +0100 | [diff] [blame] | 37 | #include "arm_compute/runtime/CL/functions/CLConcatenateLayer.h" |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 38 | #include "arm_compute/runtime/CL/functions/CLElementwiseOperations.h" |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 39 | #include "arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h" |
| 40 | #include "arm_compute/runtime/CL/functions/CLGEMM.h" |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 41 | #include "arm_compute/runtime/CL/functions/CLMeanStdDevNormalizationLayer.h" |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 42 | #include "arm_compute/runtime/IMemoryManager.h" |
Georgios Pinitas | 26014cf | 2019-09-09 19:00:57 +0100 | [diff] [blame] | 43 | #include "arm_compute/runtime/MemoryGroup.h" |
Michalis Spyrou | 25f45a4 | 2018-08-08 12:53:05 +0100 | [diff] [blame] | 44 | #include "arm_compute/runtime/common/LSTMParams.h" |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 45 | |
| 46 | #include <memory> |
| 47 | |
| 48 | namespace arm_compute |
| 49 | { |
| 50 | class ICLTensor; |
| 51 | |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 52 | /** This function performs a single time step in a Long Short-Term Memory (LSTM) layer. |
| 53 | * |
| 54 | */ |
| 55 | class CLLSTMLayer : public IFunction |
| 56 | { |
| 57 | public: |
| 58 | /** Default constructor */ |
| 59 | CLLSTMLayer(std::shared_ptr<IMemoryManager> memory_manager = nullptr); |
| 60 | /** Initialize function's tensors. |
| 61 | * |
Georgios Pinitas | 8bc745d | 2018-07-18 19:51:24 +0100 | [diff] [blame] | 62 | * @param[in] input Source tensor. Input is a 2D tensor with dimensions [input_size, batch_size]. Data types supported: F16/F32. |
| 63 | * @param[in] input_to_forget_weights 2D weights tensor with dimensions [input_size, num_units]. Data type supported: Same as @p input. |
| 64 | * @param[in] input_to_cell_weights 2D weights tensor with dimensions [input_size, num_units]. Data type supported: Same as @p input. |
| 65 | * @param[in] input_to_output_weights 2D weights tensor with dimensions [input_size, num_units]. Data type supported: Same as @p input. |
| 66 | * @param[in] recurrent_to_forget_weights 2D weights tensor with dimensions [output_size, num_units]. Data type supported: Same as @p input. |
| 67 | * @param[in] recurrent_to_cell_weights 2D weights tensor with dimensions [output_size, num_units]. Data type supported: Same as @p input. |
| 68 | * @param[in] recurrent_to_output_weights 2D weights tensor with dimensions [output_size, num_units]. Data type supported: Same as @p input. |
| 69 | * @param[in] forget_gate_bias 1D weights tensor with dimensions [num_units]. Data type supported: Same as @p input. |
| 70 | * @param[in] cell_bias 1D weights tensor with dimensions [num_units]. Data type supported: Same as @p input. |
| 71 | * @param[in] output_gate_bias 1D weights tensor with dimensions [num_units]. Data type supported: Same as @p input. |
| 72 | * @param[in] output_state_in 2D weights tensor with dimensions [output_size, batch_size]. Data type supported: Same as @p input. |
| 73 | * @param[in] cell_state_in 2D tensor with dimensions [num_units, batch_size]. Data type supported: Same as @p input. |
| 74 | * @param[out] scratch_buffer 2D tensor with dimensions [num_units * 4, batch_size] with CIFG or [num_units * 3, batch_size] without CIGF. Data type supported: Same as @p input. |
| 75 | * @param[out] output_state_out 2D weights tensor with dimensions [output_size, batch_size]. Data type supported: Same as @p input. |
| 76 | * @param[out] cell_state_out 2D tensor with dimensions [num_units, batch_size]. Data type supported: Same as @p input. |
| 77 | * @param[out] output Destination tensor. Output is a 2D tensor with dimensions [output_size, batch_size]. |
| 78 | * Data types supported: Same as @p input. |
| 79 | * @param[in] lstm_params (Optional) Weights tensors used in peephole optimization: |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 80 | * input_to_input_weights 2D weights tensor with dimensions [input_size, num_units]. Data type supported: Same as @p input. |
| 81 | * recurrent_to_input_weights 2D weights tensor with dimensions [output_size, num_units]. Data type supported: Same as @p input. |
| 82 | * cell_to_input_weights 1D weights tensor with dimensions [num_units]. Can be nullptr. Data type supported: Same as @p input. |
| 83 | * cell_to_forget_weights 1D weights tensor with dimensions [num_units]. Data type supported: Same as @p input. |
| 84 | * cell_to_output_weights 1D weights tensor with dimensions [num_units]. Data type supported: Same as @p input. |
| 85 | * input_gate_bias 1D weights tensor with dimensions [num_units]. Data type supported: Same as @p input |
| 86 | * projection_weights 2D weights tensor with dimensions [output_size, num_units]. Data type supported: Same as @p input. |
| 87 | * projection_bias 1D weights tensor with dimensions [output_size]. Data type supported: Same as @p input. |
| 88 | * input_layer_norm_coefficients 1D weights tensor with dimensions [num_units]. Data type supported: Same as @p input. |
| 89 | * forget_layer_norm_coefficients 1D weights tensor with dimensions [num_units]. Data type supported: Same as @p input. |
| 90 | * cell_layer_norm_coefficients 1D weights tensor with dimensions [num_units]. Data type supported: Same as @p input. |
| 91 | * output_layer_norm_coefficients 1D weights tensor with dimensions [num_units]. Data type supported: Same as @p input. |
Georgios Pinitas | 8bc745d | 2018-07-18 19:51:24 +0100 | [diff] [blame] | 92 | * @param[in] activation_info Contains activation information described in @ref ActivationLayerInfo. |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 93 | * @param[in] cell_threshold The clipping threshold for the cell state, such that values are bound within [-cell_clip, cell_clip]. If set to 0.0f then clipping is disabled. |
| 94 | * @param[in] projection_threshold The clipping threshold for the output from the projection layer, such that values are bound within [-proj_clip, proj_clip]. |
| 95 | * If set to 0.0f then clipping is disabled. |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 96 | */ |
Georgios Pinitas | 8bc745d | 2018-07-18 19:51:24 +0100 | [diff] [blame] | 97 | void configure(const ICLTensor *input, |
| 98 | const ICLTensor *input_to_forget_weights, const ICLTensor *input_to_cell_weights, const ICLTensor *input_to_output_weights, |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 99 | const ICLTensor *recurrent_to_forget_weights, const ICLTensor *recurrent_to_cell_weights, const ICLTensor *recurrent_to_output_weights, |
Georgios Pinitas | 8bc745d | 2018-07-18 19:51:24 +0100 | [diff] [blame] | 100 | const ICLTensor *forget_gate_bias, const ICLTensor *cell_bias, const ICLTensor *output_gate_bias, |
| 101 | const ICLTensor *output_state_in, const ICLTensor *cell_state_in, |
| 102 | ICLTensor *scratch_buffer, ICLTensor *output_state_out, ICLTensor *cell_state_out, ICLTensor *output, |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 103 | const LSTMParams<ICLTensor> &lstm_params, const ActivationLayerInfo &activation_info, float cell_threshold = 0.f, float projection_threshold = 0.f); |
| 104 | |
| 105 | /** Static function to check if given info will lead to a valid configuration of @ref CLLSTMLayer |
| 106 | * |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 107 | * @param[in] input Source tensor info. Input is a 2D tensor with dimensions [input_size, batch_size]. Data types supported: F16/F32. |
| 108 | * @param[in] input_to_forget_weights 2D weights tensor info with dimensions [input_size, num_units]. Data type supported: Same as @p input. |
| 109 | * @param[in] input_to_cell_weights 2D weights tensor info with dimensions [input_size, num_units]. Data type supported: Same as @p input. |
| 110 | * @param[in] input_to_output_weights 2D weights tensor info with dimensions [input_size, num_units]. Data type supported: Same as @p input. |
| 111 | * @param[in] recurrent_to_forget_weights 2D weights tensor info with dimensions [output_size, num_units]. Data type supported: Same as @p input. |
| 112 | * @param[in] recurrent_to_cell_weights 2D weights tensor info with dimensions [output_size, num_units]. Data type supported: Same as @p input. |
| 113 | * @param[in] recurrent_to_output_weights 2D weights tensor info with dimensions [output_size, num_units]. Data type supported: Same as @p input. |
| 114 | * @param[in] forget_gate_bias 1D weights tensor info with dimensions [num_units]. Data type supported: Same as @p input. |
| 115 | * @param[in] cell_bias 1D weights tensor info with dimensions [num_units]. Data type supported: Same as @p input. |
| 116 | * @param[in] output_gate_bias 1D weights tensor info with dimensions [num_units]. Data type supported: Same as @p input. |
| 117 | * @param[in] output_state_in 2D weights tensor info with dimensions [output_size, batch_size]. Data type supported: Same as @p input. |
| 118 | * @param[in] cell_state_in 2D tensor info with dimensions [num_units, batch_size]. Data type supported: Same as @p input. |
| 119 | * @param[in] scratch_buffer 2D tensor info with dimensions [num_units * 4, batch_size] with CIFG or [num_units * 3, batch_size] without CIGF. |
| 120 | * Data type supported: Same as @p input. |
| 121 | * @param[in] output_state_out 2D weights tensor info with dimensions [output_size, batch_size]. Data type supported: Same as @p input. |
| 122 | * @param[in] cell_state_out 2D tensor info with dimensions [num_units, batch_size]. Data type supported: Same as @p input. |
| 123 | * @param[in] output Destination tensor info. Output is a 2D tensor with dimensions [output_size, batch_size]. Data types supported: Same as @p input. |
| 124 | * @param[in] lstm_params (Optional) Weights tensors info used in peephole optimization: |
| 125 | * input_to_input_weights 2D weights tensor info with dimensions [input_size, num_units]. Data type supported: Same as @p input. |
| 126 | * recurrent_to_input_weights 2D weights tensor info with dimensions [output_size, num_units]. Data type supported: Same as @p input. |
| 127 | * cell_to_input_weights 1D weights tensor info with dimensions [num_units]. Can be nullptr. Data type supported: Same as @p input. |
| 128 | * cell_to_forget_weights 1D weights tensor info with dimensions [num_units]. Data type supported: Same as @p input. |
| 129 | * cell_to_output_weights 1D weights tensor info with dimensions [num_units]. Data type supported: Same as @p input. |
| 130 | * input_gate_bias 1D weights tensor info with dimensions [num_units]. Data type supported: Same as @p input |
| 131 | * projection_weights 2D weights tensor info with dimensions [output_size, num_units]. Data type supported: Same as @p input. |
| 132 | * projection_bias 1D weights tensor info with dimensions [output_size]. Data type supported: Same as @p input. |
| 133 | * input_layer_norm_coefficients 1D weights tensor info with dimensions [num_units]. Data type supported: Same as @p input. |
| 134 | * forget_layer_norm_coefficients 1D weights tensor info with dimensions [num_units]. Data type supported: Same as @p input. |
| 135 | * cell_layer_norm_coefficients 1D weights tensor info with dimensions [num_units]. Data type supported: Same as @p input. |
| 136 | * output_layer_norm_coefficients 1D weights tensor info with dimensions [num_units]. Data type supported: Same as @p input. |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 137 | * @param[in] activation_info Contains activation information described in @ref ActivationLayerInfo. |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 138 | * @param[in] cell_threshold The clipping threshold for the cell state, such that values are bound within [-cell_clip, cell_clip]. If set to 0.0f then clipping is disabled. |
| 139 | * @param[in] projection_threshold The clipping threshold for the output from the projection layer, such that values are bound within [-proj_clip, proj_clip]. |
| 140 | * If set to 0.0f then clipping is disabled. |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 141 | * |
| 142 | * @return a status |
| 143 | */ |
Georgios Pinitas | 8bc745d | 2018-07-18 19:51:24 +0100 | [diff] [blame] | 144 | static Status validate(const ITensorInfo *input, |
| 145 | const ITensorInfo *input_to_forget_weights, const ITensorInfo *input_to_cell_weights, const ITensorInfo *input_to_output_weights, |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 146 | const ITensorInfo *recurrent_to_forget_weights, const ITensorInfo *recurrent_to_cell_weights, const ITensorInfo *recurrent_to_output_weights, |
| 147 | const ITensorInfo *forget_gate_bias, const ITensorInfo *cell_bias, const ITensorInfo *output_gate_bias, |
Georgios Pinitas | 8bc745d | 2018-07-18 19:51:24 +0100 | [diff] [blame] | 148 | const ITensorInfo *output_state_in, const ITensorInfo *cell_state_in, |
| 149 | const ITensorInfo *scratch_buffer, const ITensorInfo *output_state_out, const ITensorInfo *cell_state_out, const ITensorInfo *output, |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 150 | const LSTMParams<ITensorInfo> &lstm_params, const ActivationLayerInfo &activation_info, float cell_threshold = 0.f, float projection_threshold = 0.f); |
| 151 | |
| 152 | // Inherited methods overridden: |
| 153 | void run() override; |
John Kesapides | cafec8f | 2019-02-19 15:53:59 +0000 | [diff] [blame] | 154 | void prepare() override; |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 155 | |
| 156 | private: |
Georgios Pinitas | 26014cf | 2019-09-09 19:00:57 +0100 | [diff] [blame] | 157 | MemoryGroup _memory_group; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 158 | CLFullyConnectedLayer _fully_connected_input_gate; |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 159 | CLArithmeticAddition _accum_input_gate1; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 160 | CLSaturatedArithmeticOperationKernel _subtract_input_gate; |
| 161 | CLPixelWiseMultiplicationKernel _pixelwise_mul_input_gate; |
| 162 | CLActivationLayerKernel _activation_input_gate; |
| 163 | CLFullyConnectedLayer _fully_connected_forget_gate; |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 164 | CLArithmeticAddition _accum_forget_gate1; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 165 | CLPixelWiseMultiplicationKernel _pixelwise_mul_forget_gate; |
| 166 | CLActivationLayerKernel _activation_forget_gate; |
| 167 | CLFullyConnectedLayer _fully_connected_cell_state; |
| 168 | CLGEMM _gemm_cell_state1; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 169 | CLTransposeKernel _transpose_cell_state; |
| 170 | CLSaturatedArithmeticOperationKernel _accum_cell_state1; |
| 171 | CLSaturatedArithmeticOperationKernel _accum_cell_state2; |
| 172 | CLPixelWiseMultiplicationKernel _pixelwise_mul_cell_state1; |
| 173 | CLActivationLayerKernel _activation_cell_state; |
| 174 | CLActivationLayerKernel _cell_clip; |
| 175 | CLPixelWiseMultiplicationKernel _pixelwise_mul_cell_state2; |
| 176 | CLFullyConnectedLayer _fully_connected_output; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 177 | CLPixelWiseMultiplicationKernel _pixelwise_mul_output_state1; |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 178 | CLArithmeticAddition _accum_output1; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 179 | CLActivationLayerKernel _activation_output; |
| 180 | CLActivationLayerKernel _activation_output_state; |
| 181 | CLPixelWiseMultiplicationKernel _pixelwise_mul_output_state2; |
| 182 | CLFullyConnectedLayer _fully_connected_output_state; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 183 | CLActivationLayerKernel _projection_clip; |
| 184 | CLCopyKernel _copy_cell_state; |
| 185 | CLCopyKernel _copy_output; |
Georgios Pinitas | 09f2497 | 2019-05-17 18:14:40 +0100 | [diff] [blame] | 186 | CLConcatenateLayer _concat_scratch_buffer; |
John Kesapides | cafec8f | 2019-02-19 15:53:59 +0000 | [diff] [blame] | 187 | CLWidthConcatenate2TensorsKernel _concat_inputs_forget_gate; |
| 188 | CLWidthConcatenate2TensorsKernel _concat_weights_forget_gate; |
| 189 | CLWidthConcatenate2TensorsKernel _concat_weights_input_gate; |
| 190 | CLWidthConcatenate2TensorsKernel _concat_weights_output; |
Georgios Pinitas | dbfc2dc | 2019-04-02 12:51:21 +0100 | [diff] [blame] | 191 | CLMemsetKernel _ones_memset_kernel; |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 192 | CLMeanStdDevNormalizationLayer _mean_std_norm_input_gate; |
| 193 | CLPixelWiseMultiplicationKernel _pixelwise_mul_input_gate_coeff; |
| 194 | CLSaturatedArithmeticOperationKernel _accum_input_gate_bias; |
| 195 | CLMeanStdDevNormalizationLayer _mean_std_norm_forget_gate; |
| 196 | CLPixelWiseMultiplicationKernel _pixelwise_mul_forget_gate_coeff; |
| 197 | CLSaturatedArithmeticOperationKernel _accum_forget_gate_bias; |
| 198 | CLMeanStdDevNormalizationLayer _mean_std_norm_cell_gate; |
| 199 | CLPixelWiseMultiplicationKernel _pixelwise_mul_cell_gate_coeff; |
| 200 | CLSaturatedArithmeticOperationKernel _accum_cell_gate_bias; |
| 201 | CLMeanStdDevNormalizationLayer _mean_std_norm_output_gate; |
| 202 | CLPixelWiseMultiplicationKernel _pixelwise_mul_output_gate_coeff; |
| 203 | CLSaturatedArithmeticOperationKernel _accum_output_gate_bias; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 204 | CLTensor _input_gate_out1; |
| 205 | CLTensor _input_gate_out2; |
| 206 | CLTensor _input_gate_out3; |
| 207 | CLTensor _input_gate_out4; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 208 | CLTensor _forget_gate_out1; |
| 209 | CLTensor _forget_gate_out2; |
| 210 | CLTensor _forget_gate_out3; |
| 211 | CLTensor _forget_gate_out4; |
| 212 | CLTensor _forget_gate_out5; |
John Kesapides | cafec8f | 2019-02-19 15:53:59 +0000 | [diff] [blame] | 213 | CLTensor _forget_gate_out6; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 214 | CLTensor _cell_state_out1; |
| 215 | CLTensor _cell_state_out2; |
| 216 | CLTensor _cell_state_out3; |
| 217 | CLTensor _cell_state_out4; |
| 218 | CLTensor _cell_state_out5; |
| 219 | CLTensor _output1; |
| 220 | CLTensor _output2; |
| 221 | CLTensor _output3; |
| 222 | CLTensor _output4; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 223 | CLTensor _cell_state_activation; |
| 224 | CLTensor _output_state1; |
| 225 | CLTensor _ones; |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 226 | CLTensor _input_layer_norm_out1; |
| 227 | CLTensor _input_layer_norm_out2; |
| 228 | CLTensor _forget_layer_norm_out1; |
| 229 | CLTensor _forget_layer_norm_out2; |
| 230 | CLTensor _cell_layer_norm_out1; |
| 231 | CLTensor _cell_layer_norm_out2; |
| 232 | CLTensor _output_layer_norm_out1; |
| 233 | CLTensor _output_layer_norm_out2; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 234 | bool _run_peephole_opt; |
| 235 | bool _run_cifg_opt; |
| 236 | bool _perform_cell_clipping; |
| 237 | bool _has_projection_weights; |
| 238 | bool _perform_projection_clipping; |
John Kesapides | cafec8f | 2019-02-19 15:53:59 +0000 | [diff] [blame] | 239 | bool _is_prepared; |
Michele Di Giorgio | 39438b4 | 2019-06-04 12:41:45 +0100 | [diff] [blame] | 240 | bool _is_layer_norm_lstm; |
Michalis Spyrou | bcedf51 | 2018-03-22 14:55:08 +0000 | [diff] [blame] | 241 | }; |
John Kesapides | cafec8f | 2019-02-19 15:53:59 +0000 | [diff] [blame] | 242 | } // namespace arm_compute |
Michalis Spyrou | f464337 | 2019-11-29 16:17:13 +0000 | [diff] [blame] | 243 | #endif /* ARM_COMPUTE_CLLSTMLAYER_H */ |