How to use variable batch size for bidirectional RNN in tensorflow
<p>It seems tensorflow does not support variable batch size for bidirectional RNN. In this example the <code>sequence_length</code> is tied to <code>batch_size</code>, which is a Python integer:</p>

<pre><code>  _seq_len = tf.fill([batch_size], tf.constant(n_steps, dtype=tf.int64))
  outputs, state1,state2 = rnn.bidirectional_rnn(rnn_fw_cell, rnn_bw_cell, input,
                                    dtype="float",
                                    sequence_length=_seq_len)
</code></pre>

<p>How can I use different batch sizes for training and testing?</p>