Tensorflow feed_dict={}

tensorflow 在有占位符  tf.placeholder时 ,需要用 feed_dict喂入数据。

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:[7],input2:[2]}))

 

posted @ 2020-04-01 16:40  小娜子成长记  阅读(276)  评论(0编辑  收藏  举报