[tf]placeholder如果只是传递一个数字那么shape这么写

  • shape可以写成[]或者None
import tensorflow as tf
import numpy as np
a = tf.placeholder(shape=[],dtype=tf.int32,name='ab')
with tf.Session() as sess:
    print(sess.run(a,feed_dict={'ab:0':1}))

猜你喜欢

转载自blog.csdn.net/weixin_33815613/article/details/87337824
今日推荐