In [1]:
import numpy as np
import tensorflow as tf
In [2]:
x1 = tf.placeholder(tf.float32)
x2 = tf.placeholder(tf.float32)
In [3]:
sum_op = tf.add(x1, x2)
product_op = tf.multiply(x1, x2)
In [7]:
with tf.Session() as sess:
sum_result = sess.run(sum_op, feed_dict={x1: 2, x2: [1, 2, 3]})
product_result = sess.run(product_op, feed_dict={x1: 2, x2: [1, 2, 3]})
In [8]:
sum_result
Out[8]:
In [9]:
product_result
Out[9]:
In [ ]: