| 507 | } |
| 508 | |
| 509 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
| 510 | const auto* params = |
| 511 | reinterpret_cast<TfLiteUnidirectionalSequenceLSTMParams*>( |
| 512 | node->builtin_data); |
| 513 | const OpData* op_data = reinterpret_cast<OpData*>(node->user_data); |
| 514 | const bool is_layer_norm_lstm = op_data->is_layer_norm_lstm; |
| 515 | const bool time_major = params->time_major; |
| 516 | const TfLiteTensor* input = GetInput(context, node, kInputTensor); |
| 517 | |
| 518 | const TfLiteTensor* input_to_input_weights = |
| 519 | GetOptionalInputTensor(context, node, kInputToInputWeightsTensor); |
| 520 | const TfLiteTensor* input_to_forget_weights = |
| 521 | GetInput(context, node, kInputToForgetWeightsTensor); |
| 522 | const TfLiteTensor* input_to_cell_weights = |
| 523 | GetInput(context, node, kInputToCellWeightsTensor); |
| 524 | const TfLiteTensor* input_to_output_weights = |
| 525 | GetInput(context, node, kInputToOutputWeightsTensor); |
| 526 | |
| 527 | const TfLiteTensor* recurrent_to_input_weights = |
| 528 | GetOptionalInputTensor(context, node, kRecurrentToInputWeightsTensor); |
| 529 | const TfLiteTensor* recurrent_to_forget_weights = |
| 530 | GetInput(context, node, kRecurrentToForgetWeightsTensor); |
| 531 | const TfLiteTensor* recurrent_to_cell_weights = |
| 532 | GetInput(context, node, kRecurrentToCellWeightsTensor); |
| 533 | const TfLiteTensor* recurrent_to_output_weights = |
| 534 | GetInput(context, node, kRecurrentToOutputWeightsTensor); |
| 535 | |
| 536 | const TfLiteTensor* cell_to_input_weights = |
| 537 | GetOptionalInputTensor(context, node, kCellToInputWeightsTensor); |
| 538 | const TfLiteTensor* cell_to_forget_weights = |
| 539 | GetOptionalInputTensor(context, node, kCellToForgetWeightsTensor); |
| 540 | const TfLiteTensor* cell_to_output_weights = |
| 541 | GetOptionalInputTensor(context, node, kCellToOutputWeightsTensor); |
| 542 | |
| 543 | const TfLiteTensor* input_gate_bias = |
| 544 | GetOptionalInputTensor(context, node, kInputGateBiasTensor); |
| 545 | const TfLiteTensor* forget_gate_bias = |
| 546 | GetInput(context, node, kForgetGateBiasTensor); |
| 547 | const TfLiteTensor* cell_bias = GetInput(context, node, kCellGateBiasTensor); |
| 548 | const TfLiteTensor* output_gate_bias = |
| 549 | GetInput(context, node, kOutputGateBiasTensor); |
| 550 | |
| 551 | const TfLiteTensor* projection_weights = |
| 552 | GetOptionalInputTensor(context, node, kProjectionWeightsTensor); |
| 553 | const TfLiteTensor* projection_bias = |
| 554 | GetOptionalInputTensor(context, node, kProjectionBiasTensor); |
| 555 | |
| 556 | // Index the scratch buffers pointers to the global scratch buffer. |
| 557 | TfLiteTensor* scratch_buffer = GetTemporary(context, node, /*index=*/0); |
| 558 | |
| 559 | TfLiteTensor* activation_state = |
| 560 | GetVariableInput(context, node, kInputActivationStateTensor); |
| 561 | TfLiteTensor* cell_state = |
| 562 | GetVariableInput(context, node, kInputCellStateTensor); |
| 563 | |
| 564 | const TfLiteTensor* input_layer_norm_coefficients = |
| 565 | is_layer_norm_lstm ? GetOptionalInputTensor( |
| 566 | context, node, kInputLayerNormCoefficientsTensor) |
nothing calls this directly
no test coverage detected