placeholder函数相当于一个占位符,tf.placeholder(dtype, shape=None, name=None)
- dtype:数据类型。常用的是tf.float32,tf.float64等数值类型
- shape:数据形状。默认是None,就是一维值,也可以多维,比如:[None,3],表示列是3,行不一定
- name:名称。
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.]
转载于:https://www.cnblogs.com/yqpy/p/11003296.html
原文链接:https://blog.csdn.net/weixin_30342827/article/details/99391944
本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。
评论前必须登录!
立即登录