outputs, states = rnn.rnn(cell, inputs, initial_state=initial_state,
    sequence_length=seq_length)
sess = tf.Session()
feed = {seq_lenght: 20}
sess.run(outputs, feed_dict=feed)
Tensorflow RNN с предложениями разной длины