TensorFlow学习之路(0):tf.placeholder() & feed_dict={}

论坛 期权论坛 脚本     
匿名技术用户   2021-1-6 02:13   243   0


使用feed_dict={}为tensor赋值,通过Session.run() or Tensor.run() or Operation.run()来实现


x = tf.placeholder(tf.float32, shape=[1024, 1024]) # x是一个tensor

y = tf.matual(x, x) #y是一个tensor

z = np.random.rand(1024, 1024)


sess.run(y, feed_dict={x: z})

y.eval(feed_dict={x: z})

y.run(feed_dict={x: z}) # if y is an operation


分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP