title: How to set Tensorflow dynamic_rnn, zero_state without a fixed batch_size?
body: <p>According to Tensorflow's official website,(<a href="https://www.tensorflow.org/api_docs/python/tf/contrib/rnn/BasicLSTMCell#zero_state" rel="noreferrer">https://www.tensorflow.org/api_docs/python/tf/contrib/rnn/BasicLSTMCell#zero_state</a>) 
  zero_state has to specify a batch_size. 
  Many examples I found use this code:</p>
  
  <pre><code>    init_state = lstm_cell.zero_state(batch_size, dtype=tf.float32)
  
      outputs, final_state = tf.nn.dynamic_rnn(lstm_cell, X_in, 
          initial_state=init_state, time_major=False)
  </code></pre>
  
  <p>For training steps, it's okay to fix the batch size. However, when predicting, the test set might not have the same shape as the training set's batch size.
  For example, one batch of my training data has shape [100, 255, 128]. The batch size is 100, with 255 steps and 128 inputs. While the test set is [2000, 255, 128]. I can't predict since in dynamic_rnn(initial_state), it already set a fixed batch_size = 100.
  How do I fix this?</p>
  
  <p>Thanks.</p>