@@ -0,0 +1,926 @@
+import tensorflow as tf%0Aimport numpy as np%0A%0Atf.set_random_seed(765)%0Anp.random.seed(765)%0Atf.reset_default_graph()%0A%0An_inputs = 3%0An_neurons = 5%0An_steps = 2%0A%0AX = tf.placeholder(tf.float32, %5BNone, n_steps, n_inputs%5D)%0Aseq_length = tf.placeholder(tf.int32, %5BNone%5D)%0A%0Abasic_cell = tf.contrib.rnn.BasicRNNCell(num_units=n_neurons)%0Aoutputs, states = tf.nn.dynamic_rnn(basic_cell, X, sequence_length=seq_length,%0A    dtype=tf.float32)%0A%0Ainit = tf.global_variables_initializer()%0A%0AX_batch = np.array(%5B%0A        %5B%5B0, 1, 2%5D, %5B9, 8, 7%5D%5D, # instance 1%0A        %5B%5B3, 4, 5%5D, %5B0, 0, 0%5D%5D, # instance 2%0A        %5B%5B6, 7, 8%5D, %5B6, 5, 4%5D%5D, # instance 3%0A        %5B%5B9, 0, 1%5D, %5B3, 2, 1%5D%5D, # instance 4%0A    %5D)%0A%0Aseq_length_batch = np.array(%5B2,1,2,2%5D)%0A%0Awith tf.Session() as sess:%0A    init.run()%0A    outputs_val, states_val = sess.run(%0A        %5Boutputs, states%5D, feed_dict=%7BX: X_batch, seq_length: seq_length_batch%7D%0A    )%0A    print(outputs_val)%0A    print(states_val)

Add code for setting sequence length for RNN