Tensorflow机器学习4 placeholder用法

import tensorflow as tf

#P12 例子 https://www.bilibili.com/video/av16001891/?p=12

input1 = tf.placeholder(tf.float32)
input2 = tf.placeholder(tf.float32)

output = tf.multiply(input1,input2)

with tf.Session() as sess:
    print(sess.run(output, feed_dict={input1:[7.],input2:[2.]}))

运行结果:

[14.]

你可能感兴趣的:(Tensorflow机器学习4 placeholder用法)