#include <math.h>
#include <algorithm>
#include <cstddef>
#include "tensorflow/lite/core/c/builtin_op_data.h"
#include "tensorflow/lite/core/c/common.h"
#include "tensorflow/lite/kernels/cpu_backend_context.h"
#include "tensorflow/lite/kernels/internal/compatibility.h"
#include "tensorflow/lite/kernels/internal/kernel_utils.h"
#include "tensorflow/lite/kernels/internal/tensor_utils.h"
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/lite/kernels/lstm_eval.h"
#include "tensorflow/lite/kernels/op_macros.h"
namespace tflite {
namespace ops {
namespace builtin {
namespace bidirectional_sequence_lstm {
constexpr int kInputTensor = …;
constexpr int kFwInputToInputWeightsTensor = …;
constexpr int kFwInputToForgetWeightsTensor = …;
constexpr int kFwInputToCellWeightsTensor = …;
constexpr int kFwInputToOutputWeightsTensor = …;
constexpr int kFwRecurrentToInputWeightsTensor = …;
constexpr int kFwRecurrentToForgetWeightsTensor = …;
constexpr int kFwRecurrentToCellWeightsTensor = …;
constexpr int kFwRecurrentToOutputWeightsTensor = …;
constexpr int kFwCellToInputWeightsTensor = …;
constexpr int kFwCellToForgetWeightsTensor = …;
constexpr int kFwCellToOutputWeightsTensor = …;
constexpr int kFwInputGateBiasTensor = …;
constexpr int kFwForgetGateBiasTensor = …;
constexpr int kFwCellGateBiasTensor = …;
constexpr int kFwOutputGateBiasTensor = …;
constexpr int kFwProjectionWeightsTensor = …;
constexpr int kFwProjectionBiasTensor = …;
constexpr int kBwInputToInputWeightsTensor = …;
constexpr int kBwInputToForgetWeightsTensor = …;
constexpr int kBwInputToCellWeightsTensor = …;
constexpr int kBwInputToOutputWeightsTensor = …;
constexpr int kBwRecurrentToInputWeightsTensor = …;
constexpr int kBwRecurrentToForgetWeightsTensor = …;
constexpr int kBwRecurrentToCellWeightsTensor = …;
constexpr int kBwRecurrentToOutputWeightsTensor = …;
constexpr int kBwCellToInputWeightsTensor = …;
constexpr int kBwCellToForgetWeightsTensor = …;
constexpr int kBwCellToOutputWeightsTensor = …;
constexpr int kBwInputGateBiasTensor = …;
constexpr int kBwForgetGateBiasTensor = …;
constexpr int kBwCellGateBiasTensor = …;
constexpr int kBwOutputGateBiasTensor = …;
constexpr int kBwProjectionWeightsTensor = …;
constexpr int kBwProjectionBiasTensor = …;
constexpr int kFwInputActivationStateTensor = …;
constexpr int kFwInputCellStateTensor = …;
constexpr int kBwInputActivationStateTensor = …;
constexpr int kBwInputCellStateTensor = …;
constexpr int kAuxInputTensor = …;
constexpr int kFwAuxInputToInputWeightsTensor = …;
constexpr int kFwAuxInputToForgetWeightsTensor = …;
constexpr int kFwAuxInputToCellWeightsTensor = …;
constexpr int kFwAuxInputToOutputWeightsTensor = …;
constexpr int kBwAuxInputToInputWeightsTensor = …;
constexpr int kBwAuxInputToForgetWeightsTensor = …;
constexpr int kBwAuxInputToCellWeightsTensor = …;
constexpr int kBwAuxInputToOutputWeightsTensor = …;
constexpr int kFwOutputTensor = …;
constexpr int kBwOutputTensor = …;
enum TemporaryTensor { … };
struct OpData { … };
void* Init(TfLiteContext* context, const char* buffer, size_t length) { … }
void Free(TfLiteContext* context, void* buffer) { … }
TfLiteStatus CheckLstmTensorDimensionsAndTypes(
TfLiteContext* context, TfLiteNode* node, int n_input, int n_output,
int n_cell, int input_to_input_weights_tensor,
int input_to_forget_weights_tensor, int input_to_cell_weights_tensor,
int input_to_output_weights_tensor, int recurrent_to_input_weights_tensor,
int recurrent_to_forget_weights_tensor,
int recurrent_to_cell_weights_tensor,
int recurrent_to_output_weights_tensor, int cell_to_input_weights_tensor,
int cell_to_forget_weights_tensor, int cell_to_output_weights_tensor,
int input_gate_bias_tensor, int forget_gate_bias_tensor,
int cell_gate_bias_tensor, int output_gate_bias_tensor,
int projection_weights_tensor, int projection_bias_tensor) { … }
TfLiteStatus CheckInputTensorDimensions(TfLiteContext* context,
TfLiteNode* node, int n_input,
int n_output, int n_cell) { … }
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { … }
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { … }
}
TfLiteRegistration* Register_BIDIRECTIONAL_SEQUENCE_LSTM() { … }
}
}
}