MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / LstmStepQuantized

Function LstmStepQuantized

tensorflow/lite/kernels/lstm_eval.cc:888–1053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886}
887
888inline void LstmStepQuantized(
889 const int8_t* input_ptr, int32_t input_zp,
890 const int8_t* input_to_input_weight_ptr,
891 int32_t effective_input_to_input_scale_a,
892 int32_t effective_input_to_input_scale_b,
893 const int8_t* input_to_forget_weight_ptr,
894 int32_t effective_input_to_forget_scale_a,
895 int32_t effective_input_to_forget_scale_b,
896 const int8_t* input_to_cell_weight_ptr,
897 int32_t effective_input_to_cell_scale_a,
898 int32_t effective_input_to_cell_scale_b,
899 const int8_t* input_to_output_weight_ptr,
900 int32_t effective_input_to_output_scale_a,
901 int32_t effective_input_to_output_scale_b,
902 const int8_t* recurrent_to_input_weight_ptr,
903 int32_t effective_recurrent_to_input_scale_a,
904 int32_t effective_recurrent_to_input_scale_b,
905 const int8_t* recurrent_to_forget_weight_ptr,
906 int32_t effective_recurrent_to_forget_scale_a,
907 int32_t effective_recurrent_to_forget_scale_b,
908 const int8_t* recurrent_to_cell_weight_ptr,
909 int32_t effective_recurrent_to_cell_scale_a,
910 int32_t effective_recurrent_to_cell_scale_b,
911 const int8_t* recurrent_to_output_weight_ptr,
912 int32_t effective_recurrent_to_output_scale_a,
913 int32_t effective_recurrent_to_output_scale_b,
914 const int8_t* cell_to_input_weight_ptr,
915 int32_t effective_cell_to_input_scale_a,
916 int32_t effective_cell_to_input_scale_b,
917 const int8_t* cell_to_forget_weight_ptr,
918 int32_t effective_cell_to_forget_scale_a,
919 int32_t effective_cell_to_forget_scale_b,
920 const int8_t* cell_to_output_weight_ptr,
921 int32_t effective_cell_to_output_scale_a,
922 int32_t effective_cell_to_output_scale_b, const int8_t* proj_weight_ptr,
923 int32_t effective_proj_scale_a, int32_t effective_proj_scale_b,
924 const int16_t* layer_norm_input_weight_ptr,
925 int32_t layer_norm_input_scale_a, int32_t layer_norm_input_scale_b,
926 const int16_t* layer_norm_forget_weight_ptr,
927 int32_t layer_norm_forget_scale_a, int32_t layer_norm_forget_scale_b,
928 const int16_t* layer_norm_cell_weight_ptr, int32_t layer_norm_cell_scale_a,
929 int32_t layer_norm_cell_scale_b,
930 const int16_t* layer_norm_output_weight_ptr,
931 int32_t layer_norm_output_scale_a, int32_t layer_norm_output_scale_b,
932 const int32_t* input_bias_ptr, const int32_t* forget_bias_ptr,
933 const int32_t* cell_bias_ptr, const int32_t* output_bias_ptr,
934 const int32_t* proj_bias_ptr, int32 quantized_cell_clip,
935 int32 quantized_proj_clip, const int32_t* inv_large_value, int32 n_batch,
936 int32 n_cell, int32 n_input, int32 n_output, int32 output_batch_leading_dim,
937 int8_t* activation_ptr, int32_t activation_zp, int16_t* cell_ptr,
938 int8_t* output_ptr, int16_t* scratch_0_ptr, int16_t* scratch_1_ptr,
939 int16_t* scratch_2_ptr, int16_t* scratch_3_ptr, int8_t* scratch_4_ptr) {
940 // Set scratch to 0.
941 memset(scratch_0_ptr, 0, n_batch * n_cell * sizeof(int16_t));
942 memset(scratch_1_ptr, 0, n_batch * n_cell * sizeof(int16_t));
943 memset(scratch_2_ptr, 0, n_batch * n_cell * sizeof(int16_t));
944 memset(scratch_3_ptr, 0, n_batch * n_cell * sizeof(int16_t));
945

Callers 1

EvalQuantizedFunction · 0.85

Calls 8

ApplyLayerNormFunction · 0.50
ApplySigmoidFunction · 0.50
ApplyTanh3Function · 0.50
CwiseMulFunction · 0.50
CwiseAddFunction · 0.50
CwiseClippingFunction · 0.50
ApplyTanh4Function · 0.50

Tested by

no test coverage detected