title: How to get values in TensorArray which contain vary shape tensors
body: <p>I get a TensorArray that contain a list of vary shape tensors through <code>tf.while_loop()</code>, but I don't know how to get them as a normal list with tensors.</p>
  
  <p>For example: </p>
  
  <pre><code>TensorArray([[1,2], [1,2,3], ...]) -&gt; [Tensor([1,2]), Tensor([1,2,3]), ...]
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code>res = tf.TensorArray(dtype=tf.int32, size=0, dynamic_size=True, infer_shape=False)
  res = res.write(0, (1, 2))
  res = res.write(0, (1, 2, 3))
  with tf.Session() as sess:                                                        
       print sess.run(res.stack())
  </code></pre>
  
  <p>I get the error message in <code>sess.run(res.stack())</code></p>
  
  <blockquote>
    <p>TensorArray has inconsistent shapes.  Index 0 has shape: [2] but index 1 has shape: [3]</p>
  </blockquote>