| 894 | } |
| 895 | |
| 896 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
| 897 | const auto* params = reinterpret_cast<TfLiteLSTMParams*>(node->builtin_data); |
| 898 | OpData* op_data = reinterpret_cast<OpData*>(node->user_data); |
| 899 | const bool is_layer_norm_lstm = op_data->is_layer_norm_lstm; |
| 900 | |
| 901 | const TfLiteTensor* input = GetInput(context, node, kInputTensor); |
| 902 | |
| 903 | const TfLiteTensor* input_to_input_weights = |
| 904 | GetOptionalInputTensor(context, node, kInputToInputWeightsTensor); |
| 905 | const TfLiteTensor* input_to_forget_weights = |
| 906 | GetInput(context, node, kInputToForgetWeightsTensor); |
| 907 | const TfLiteTensor* input_to_cell_weights = |
| 908 | GetInput(context, node, kInputToCellWeightsTensor); |
| 909 | const TfLiteTensor* input_to_output_weights = |
| 910 | GetInput(context, node, kInputToOutputWeightsTensor); |
| 911 | |
| 912 | const TfLiteTensor* recurrent_to_input_weights = |
| 913 | GetOptionalInputTensor(context, node, kRecurrentToInputWeightsTensor); |
| 914 | const TfLiteTensor* recurrent_to_forget_weights = |
| 915 | GetInput(context, node, kRecurrentToForgetWeightsTensor); |
| 916 | const TfLiteTensor* recurrent_to_cell_weights = |
| 917 | GetInput(context, node, kRecurrentToCellWeightsTensor); |
| 918 | const TfLiteTensor* recurrent_to_output_weights = |
| 919 | GetInput(context, node, kRecurrentToOutputWeightsTensor); |
| 920 | |
| 921 | const TfLiteTensor* cell_to_input_weights = |
| 922 | GetOptionalInputTensor(context, node, kCellToInputWeightsTensor); |
| 923 | const TfLiteTensor* cell_to_forget_weights = |
| 924 | GetOptionalInputTensor(context, node, kCellToForgetWeightsTensor); |
| 925 | const TfLiteTensor* cell_to_output_weights = |
| 926 | GetOptionalInputTensor(context, node, kCellToOutputWeightsTensor); |
| 927 | |
| 928 | const TfLiteTensor* input_layer_norm_coefficients = |
| 929 | is_layer_norm_lstm ? GetOptionalInputTensor( |
| 930 | context, node, kInputLayerNormCoefficientsTensor) |
| 931 | : nullptr; |
| 932 | const TfLiteTensor* forget_layer_norm_coefficients = |
| 933 | is_layer_norm_lstm |
| 934 | ? GetInput(context, node, kForgetLayerNormCoefficientsTensor) |
| 935 | : nullptr; |
| 936 | const TfLiteTensor* cell_layer_norm_coefficients = |
| 937 | is_layer_norm_lstm |
| 938 | ? GetInput(context, node, kCellLayerNormCoefficientsTensor) |
| 939 | : nullptr; |
| 940 | const TfLiteTensor* output_layer_norm_coefficients = |
| 941 | is_layer_norm_lstm |
| 942 | ? GetInput(context, node, kOutputLayerNormCoefficientsTensor) |
| 943 | : nullptr; |
| 944 | |
| 945 | const TfLiteTensor* input_gate_bias = |
| 946 | GetOptionalInputTensor(context, node, kInputGateBiasTensor); |
| 947 | const TfLiteTensor* forget_gate_bias = |
| 948 | GetInput(context, node, kForgetGateBiasTensor); |
| 949 | const TfLiteTensor* cell_bias = GetInput(context, node, kCellGateBiasTensor); |
| 950 | const TfLiteTensor* output_gate_bias = |
| 951 | GetInput(context, node, kOutputGateBiasTensor); |
| 952 | |
| 953 | const TfLiteTensor* projection_weights = |
nothing calls this directly
no test coverage detected