import tensorflow as tf

  def buildLstmLayer(self):
    return tf.keras.layers.StackedRNNCells([
        tf.lite.experimental.nn.TFLiteLSTMCell(
            self.num_units, use_peepholes=True, forget_bias=1.0, name="rnn1"),
        tf.lite.experimental.nn.TFLiteLSTMCell(
            self.num_units, num_proj=8, forget_bias=1.0, name="rnn2"),
        tf.lite.experimental.nn.TFLiteLSTMCell(
            self.num_units // 2,
            use_peepholes=True,
            num_proj=8,
            forget_bias=0,
            name="rnn3"),
        tf.lite.experimental.nn.TFLiteLSTMCell(
            self.num_units, forget_bias=1.0, name="rnn4")
    ])

  def buildModel(self, lstm_layer, is_dynamic_rnn):
    """Build Mnist recognition model.

    Args:
      lstm_layer: The lstm layer either a single lstm cell or a multi lstm cell.
      is_dynamic_rnn: Use dynamic_rnn or not.

    Returns:
