title: Tensorflow - why do all the elements in my array of tensors end up eval-ing into the exact same result?
body: <p>I'm trying to create a 10x3 tensor out of ten 1x3 tensors. This is my attempt to do so:</p>
  
  <pre><code>import tensorflow as tf
  
  g = tf.Graph()
  res = []
  with g.as_default():
    with tf.Session() as sess:
      dr1 = tf.Variable(tf.random_uniform([1], minval=1, maxval=7, dtype=tf.int32, seed=0))
      dr2 = tf.Variable(tf.random_uniform([1], minval=1, maxval=7, dtype=tf.int32, seed=1))
      rowres = tf.add(dr1, dr2)
      init = tf.global_variables_initializer()
  
      for i in range(5):
        sess.run(init)
        row = tf.concat([dr1, dr2, rowres], 0)
        res.append(row)
        res_tsr = tf.stack(res)
        print(res_tsr.eval())
  </code></pre>
  
  <p>My problem is that, with this setup, when I evaluate the resulting stacked tensor in <code>res_tsr</code>, every single tensor seems to be the same:</p>
  
  <pre><code>first loop    [[4 4 8]]
  second loop   [[4 4 8] [4 4 8]]
  third loop    [[2 3 5] [2 3 5] [2 3 5]]
  fourth loop   [[4 1 5] [4 1 5] [4 1 5] [4 1 5]]
  fifth loop    [[3 6 9] [3 6 9] [3 6 9] [3 6 9] [3 6 9]]
  expected      [[4 4 8] [4 4 8] [2 3 5] [4 1 5] [3 6 9]]
  </code></pre>
  
  <p>All of them take the values of the last tensor added to the list.</p>
  
  <p>What I expected is to have each tensor to evaluate differently like in the <code>expected</code> row. So what am I doing wrong?</p>