Fetches

To fetch the outputs from the graph, we have to execute the run() method, which is inside the Session object. We can pass the ops to the run() method and retrieve the output as tensors:

    a = tf.constant(12) 
    b = tf.constant(34) 
    add = tf.add(a,b) 
    sess = tf.Sessions() 
    result = sess.run(add) 
    print(result) 

In the preceding code, the value of result will be 12+34.

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

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