In [ ]:
import tensorflow as tf
a = tf.placeholder(tf.float32)
b = tf.placeholder(tf.float32)
adder_node = a+ b
sess=tf.Session()
print( sess.run( adder_node , { a:3, b:4.5}))

In [ ]:
import tensorflow as tf
# 2-D tensor `a`
a = tf.constant([1, 2, 3, 4, 5, 6], shape=[2, 3]) #=> [[1. 2. 3.][4. 5. 6.]]
# 2-D tensor `b`
b = tf.constant([7, 8, 9, 10, 11, 12], shape=[3, 2]) #=> [[7. 8.][9. 10.][11. 12.]]
c = tf.matmul(a, b) #=> [[58 64] [139 154]]
sess=tf.Session()
print( sess.run(c))

In [ ]:
#run this program on python shell
import tensorflow as tf
# Creates a graph.
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
# Creates a session with log_device_placement set to True.
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
# Runs the op.
print(sess.run(c))