import tensorflow as tf

    # x is shaped [batch_size,time_steps,num_inputs]
    if is_dynamic_rnn:
      lstm_input = tf.transpose(x, perm=[1, 0, 2])
      outputs, _ = tf.lite.experimental.nn.dynamic_rnn(
