【tensorflow】feed操作

feed array

1:預設placeholder:

self.xxx = tf.placeholder(dtype=tf.float32, shape=[xxx, xxx], name='xxx')

2:喂numpy.ndarray格式的矩陣進去:

xxx = sess.run(self.xxx, feed_dict={self.xxx: xx_array})

feed variable

1:預設placeholder:

self.xxx = tf.placeholder(dtype=tf.float32, name='xxx')

2:喂任意變量進去:

xxx = sess.run(self.xxx, feed_dict={self.xxx: xx_variable})
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章