title: aggregate rows into tensorflow variable
body: <p>I have a tf.Variable tensor that should work as a result aggregator.</p>
  
  <p>The idea is that I will execute an operation on the graph with batches of data and the results should be appended as new rows to my result Variable.</p>
  
  <p>Because at the beginning the variable should be empty, I initialize it like this:</p>
  
  <pre><code>result_tensor = tf.Variable(0, expected_shape=[0, 5], dtype=tf.float32)
  </code></pre>
  
  <p>Then, what I do is concatenate the new rows along the axis 0 (as new rows):</p>
  
  <pre><code>total_output = tf.concat([result_tensor, operation], 0)
  </code></pre>
  
  <p>Finally, I reassign the variable:</p>
  
  <pre><code>assign_op = tf.assign(result_tensor, total_output, validate_shape=False)
  </code></pre>
  
  <p>However, when all of this is run, I get the following error:</p>
  
  <pre><code>ValueError: Shape must be rank 0 but is rank 2 for 'concat_1' (op: 'ConcatV2') with input shapes: [], [?,25088], [].
  </code></pre>
  
  <p>Can you guys help me to find the obvious thing that I'm doing wrong?</p>
  
  <p>Thanks!</p>