From d5c020a20514cad8c78f0ab2cc46a03607854a49 Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Wed, 6 May 2020 21:01:19 +0100 Subject: COMPMID-3239: Fix projection and peephole in NEQLSTMLayer - Peephole and projection has been fixed to be working - Small internal kernel copying data between tensors to cover the case where num_units and output_size is different is added. Below is strictly outside of this patch's scope but are changes helping this patch working (directly or indirectly) or making NEQLSTM more complete. - Consideration for layer normalization is added to InfoHelpers - QSYMM8 data type is added to helper function to print out tensors. - NE/CLLSTMLayer::validate() logic has been modified to use correct value for shape validation. Change-Id: I40b4e71dfdbe8432caa2fe4a9af60a725362cc33 Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3157 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Comments-Addressed: Arm Jenkins --- arm_compute/core/utils/misc/InfoHelpers.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'arm_compute/core/utils/misc/InfoHelpers.h') diff --git a/arm_compute/core/utils/misc/InfoHelpers.h b/arm_compute/core/utils/misc/InfoHelpers.h index 8cf701c124..6ecda7a0dd 100644 --- a/arm_compute/core/utils/misc/InfoHelpers.h +++ b/arm_compute/core/utils/misc/InfoHelpers.h @@ -90,6 +90,23 @@ inline void build_lstm_params_tensor_info(const LSTMParams &lstm_params, lstm_params_info->set_cifg_params(lstm_params.input_to_input_weights()->info(), lstm_params.recurrent_to_input_weights()->info(), cell_to_input_weights_info, lstm_params.input_gate_bias()->info()); } + if(lstm_params.use_layer_norm()) + { + ARM_COMPUTE_ERROR_ON_NULLPTR(lstm_params.forget_layer_norm_weights(), + lstm_params.output_layer_norm_weights(), + lstm_params.cell_layer_norm_weights()); + if(!lstm_params.has_cifg_opt()) + { + ARM_COMPUTE_ERROR_ON_NULLPTR(lstm_params.input_layer_norm_weights()); + } + + const ITensorInfo *forget_info = lstm_params.forget_layer_norm_weights()->info(); + const ITensorInfo *cell_info = lstm_params.cell_layer_norm_weights()->info(); + const ITensorInfo *output_info = lstm_params.output_layer_norm_weights()->info(); + const ITensorInfo *input_info = lstm_params.has_cifg_opt() ? nullptr : lstm_params.input_layer_norm_weights()->info(); + + lstm_params_info->set_layer_normalization_params(input_info, forget_info, cell_info, output_info); + } } } // namespace info_helpers } // namespace utils -- cgit v1.2.1