对于这样一条语句
x = tf.placeholder("float",shape=(1,2))
我的理解是在内存中开辟了一块内存,大小为1x2的float数组;
然后再程序的运行过程中,可不断用以下语句来“喂”它,达到随时改变数据集的目的
 feed_dict={x:[[1,2]]}
测试代码
#coding=utf-8
import tensorflow as tf
x = tf.placeholder("float",shape=(1,2))
sess = tf.Session()
sess.run(tf.global_variables_initializer())
a = x
y = sess.run(a, feed_dict={x:[[1,2]]})
print(y)
sess.close

相关文章:

  • 2021-10-27
  • 2021-06-07
  • 2021-07-27
  • 2021-06-30
  • 2021-09-27
  • 2021-08-04
  • 2021-08-28
  • 2021-10-16
猜你喜欢
  • 2021-08-20
  • 2021-09-03
  • 2021-05-15
  • 2022-12-23
  • 2021-04-02
  • 2021-11-18
  • 2021-08-30
相关资源
相似解决方案