I have to run something like the following code

```
import tensorflow as tf

sess = tf.Session()
x = tf.Variable(42.)

for i in range(10000):
    sess.run(x.assign(42.))
    sess.run(x)
    print(i)

```

several times. The actual code is much more complicated and uses more variables.
The problem is that the TensorFlow graph grows with each instantiated assign op, which makes the graph grow, eventually slowing down the computation.

I could use `feed_dict=` to set the value, but I would like to keep my state in the graph, so that I can easily query it in other places.

Is there some way of avoiding cluttering the current graph in this case?