Testing the installation

In this section, we will use TensorFlow to compute a simple math operation. First, open your terminal on Linux/macOS or Windows PowerShell in Windows.

Now, we need to run python to use TensorFlow with the following command:

python

Enter the following program in the Python shell:

import tensorflow as tf
a = tf.constant(1.0)
b = tf.constant(2.0)
c = a + b
sess = tf.Session()
print(sess.run(c))

The result will look like the following screen where 3.0 is printed at the end:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.254.103