tf.gather 实例

来源:互联网 发布:2017年网络知识竞赛 编辑:程序博客网 时间:2024/05/13 18:34
import tensorflow as tftemp = tf.range(0,10)*10 + tf.constant(1,shape=[10])temp2 = tf.gather(temp,[1,5,9])with tf.Session() as sess:    print sess.run(temp)    print sess.run(temp2)

输出
[ 1 11 21 31 41 51 61 71 81 91]
[11 51 91]

0 0
原创粉丝点击