Python‎ > ‎tensorflow‎ > ‎

Session

http://www.adilwaseem.com/

 The session printed the value of two tensors
 import tensorflow as tf
x=tf.constant([round(.3)])
y=tf.constant([2])
c=tf.add(x,y)


with tf.Session() as session:
result=session.run(c)
print(result)
 [3]


 The session printed the tensorflow value.
import tensorflow as tf
a = tf.constant(5.0)
b = tf.constant(6.0)
c = a * b
sess = tf.Session()
print(sess.run(c))

 


Comments