In [1]:
import tensorflow as tf

In [2]:
a = tf.constant(10)
b = tf.constant(20)
c = a + b

In [3]:
c


Out[3]:
<tf.Tensor 'add:0' shape=() dtype=int32>

In [4]:
with tf.Session() as sess:
    result = sess.run(c)
    print(result)


30

In [5]:
a = tf.placeholder(tf.float32)
b = tf.placeholder(tf.float32)
c = a + b

In [6]:
c


Out[6]:
<tf.Tensor 'add_1:0' shape=<unknown> dtype=float32>

In [7]:
with tf.Session() as sess:
    result = sess.run(c, feed_dict={a: 10, b: 20})
    print(result)


30.0