In [1]:
import tensorflow as tf
In [2]:
a = tf.constant(10)
b = tf.constant(20)
c = a + b
In [3]:
c
Out[3]:
In [4]:
with tf.Session() as sess:
result = sess.run(c)
print(result)
In [5]:
a = tf.placeholder(tf.float32)
b = tf.placeholder(tf.float32)
c = a + b
In [6]:
c
Out[6]:
In [7]:
with tf.Session() as sess:
result = sess.run(c, feed_dict={a: 10, b: 20})
print(result)