<jupyter_start><jupyter_text>Declare variablesThat’s all there is to it! The most important thing to understand is that this code doesnot actually perform any computation, even though it looks like it does (especially thelast line). It just creates a computation graph.![Image](img/Fig_2.2.PNG)<jupyter_code>x = tf.Variable(3)
y = tf.Variable(4)
f = x*x*y + y + 2<jupyter_output><empty_output><jupyter_text>SessionA TensorFlow session takes care of placingthe operations onto devices such as CPUs and GPUs and running them, and it holdsall the variable values<jupyter_code>sess = tf.Session()
sess.run(x.initializer)
sess.run(y.initializer)
result = sess.run(f)
print(result)<jupyter_output>42<jupyter_text>Having to repeat sess.run() all the time is a bit cumbersome, but fortunately there isa better way:<jupyter_code>with tf.Session() as sess:
    x.initializer.run()
    y.initializer.run()
    result = f.eval()
    
print(result)<jupyter_output>42
StarcoderdataJupyterStructuredCleanDedup