标签:class pre 一个 code input imp 字典 允许 inpu
placeholder 允许在用session.run()运行结果的时候给输入一个值
import tensorflow as tf 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: [4.], input2: [5.]})) #传入的feed_dict是一个字典值
运行结果:
标签:class pre 一个 code input imp 字典 允许 inpu
原文地址:https://www.cnblogs.com/francischeng/p/9690385.html