I get a TensorArray that contain a list of vary shape tensors through tf.while_loop(), but I don't know how to get them as a normal list with tensors.
For example:
TensorArray([[1,2], [1,2,3], ...]) -> [Tensor([1,2]), Tensor([1,2,3]), ...]
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())
I get the error message in sess.run(res.stack())
TensorArray has inconsistent shapes. Index 0 has shape: [2] but index 1 has shape: [3]