title: Avoiding duplicating graph in tensorflow (LSTM model)
body: <p>I have the following simplified code (actually, unrolled LSTM model):</p>
  
  <pre><code>def func(a, b):
      with tf.variable_scope('name'):
          res = tf.add(a, b)
      print(res.name)
      return res
  
  func(tf.constant(10), tf.constant(20))
  </code></pre>
  
  <p>Whenever I run the last line, it seems that it changes the graph. But I don't want the graph changes. Actually my code is different and is a neural network model but it is too huge, so I've added the above code. I want to call the <code>func</code> without changing the graph of model but it changes. I read about variable scope in <code>TensorFlow</code> but it seems that I've not understand it at all.</p>