import tensorflow as tf
input1 = tf.placeholder(tf.float32)
input2 = tf.placeholder(tf.float32)
'''
注意:
multiply 是元素相乘
matmul 是矩阵相乘
'''
output = tf.multiply(input1, input2)
with tf.Session() as sess:
print(sess.run(output, feed_dict={input1: [7.], input2: [2.]}))
feed_dict 的作用就是将 placeholder 的部分填上