/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_LITE_KERNELS_LSTM_SHARED_H_ #define TENSORFLOW_LITE_KERNELS_LSTM_SHARED_H_ namespace tflite { namespace ops { namespace builtin { namespace lstm { // For full inputs kernel (24-inputs). // Please note the 20-input full kernel is deprecated and only kept // here for backward compatibility. namespace full { // Input Tensors of size {n_batch, n_input} constexpr int kInputTensor = …; // Input weight tensors of size: {n_cell, n_input} constexpr int kInputToInputWeightsTensor = …; // Optional constexpr int kInputToForgetWeightsTensor = …; constexpr int kInputToCellWeightsTensor = …; constexpr int kInputToOutputWeightsTensor = …; // Recurrent weight tensors of size {n_cell, n_output} constexpr int kRecurrentToInputWeightsTensor = …; // Optional constexpr int kRecurrentToForgetWeightsTensor = …; constexpr int kRecurrentToCellWeightsTensor = …; constexpr int kRecurrentToOutputWeightsTensor = …; // Peephole weights tensors of size {n_cell}, representing a diagonal matrix. constexpr int kCellToInputWeightsTensor = …; // Optional constexpr int kCellToForgetWeightsTensor = …; // Optional constexpr int kCellToOutputWeightsTensor = …; // Optional // Gates bias tensors of size {n_cell} constexpr int kInputGateBiasTensor = …; // Optional constexpr int kForgetGateBiasTensor = …; constexpr int kCellGateBiasTensor = …; constexpr int kOutputGateBiasTensor = …; // Projection weight tensor of size {n_output, n_cell} constexpr int kProjectionWeightsTensor = …; // Optional // Projection bias tensor of size {n_output} constexpr int kProjectionBiasTensor = …; // Optional // These state tensors are defined as variable tensors, and will be modified by // this op. constexpr int kOutputStateTensor = …; constexpr int kCellStateTensor = …; // Layer norm coefficient tensors of size {n_cell}, representing a diagonal // matrix. constexpr int kInputLayerNormCoefficientsTensor = …; // Optional constexpr int kForgetLayerNormCoefficientsTensor = …; // Optional constexpr int kCellLayerNormCoefficientsTensor = …; // Optional constexpr int kOutputLayerNormCoefficientsTensor = …; // Optional // Output tensors. constexpr int kOutputTensor = …; } // namespace full } // namespace lstm } // namespace builtin } // namespace ops } // namespace tflite #endif // TENSORFLOW_LITE_KERNELS_LSTM_SHARED_H_