TensorFlow莫烦 placehoder (三)

来源:互联网 发布:非农历史数据统计 编辑:程序博客网 时间:2024/06/09 16:44

placeholder 传入值要用字典

并且tf.mul、tf.sub 和 tf.neg 被弃用,现在使用的是 tf.multiply、tf.subtract 和 tf.negative.

import tensorflow as tfinput1=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.0],input2:[2.0]}))
0 0
原创粉丝点击