August 2018
Intermediate to advanced
272 pages
7h 2m
English
Now we have constructed all the parts of our computational graph. The very final thing we need to do is create a tf.Session and run our graph. The TensorFlow session is a way to connect your TensorFlow program, written in Python, with the C++ runtime powering TensorFlow. The session also gives TensorFlow access to devices such as CPUs and GPUs present on your local or remote machine. In addition, the session will cache information about the constructed graph so computation can be efficiently run many times.
The standard way to create a session is to do so using a Python context manager: the with statement block:
with tf.Session() as sess:.
The reason for this is that when you create a session, it has control of CPU, memory, ...
Read now
Unlock full access