<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
{'fraction_non_alphanumeric': 0.09653725078698845, 'fraction_numerical': 0.00944386149003148, 'mean_word_length': 5.671328671328672, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '18056', 'license': 'Apache-1.1', 'n_tokens_mistral': 325, 'n_tokens_neox': 312, 'n_words': 98, 'path': 'Example_3_fig_2.2.ipynb', 'repo_name': 'shakirul15-311/learn.tensorflow', 'size': '953'}