tensorflow 中tf.gather(params, indices, validate_indices=None, name=None) 函数讲解
来源:互联网 发布:ios上传图片数组 编辑:程序博客网 时间:2024/05/21 20:30
tf.gather
tf.gather(params, indices, validate_indices=None, name=None, axis=0)
params 表示你输入的张量,indices表示你想要params张量中切片的维度,所以这个函数就是挑选出params中indices对应的数。
举例子
x = tf.constant(np.arange(8).reshape((2,2,2)))y = tf.gather(x,[0])sess = tf.Session()print(sess.run(y))print('---------')print(sess.run(x))
[[[0 1] [2 3]]]---------[[[0 1] [2 3]] [[4 5] [6 7]]]
就相当把x矩阵的第一个切片取出来了
想要其他轴切片,可以设置axis这个参数
阅读全文
0 0
- tensorflow 中tf.gather(params, indices, validate_indices=None, name=None) 函数讲解
- tf.gather_nd(params, indices, name=None)
- tensorflow tf.equal(x, y, name=None)
- tf.one_hot(indices, depth, on_value=None, off_value=None, axis=None)
- tf.is_finite(x, name=None)
- tf.equal(x, y, name=None)
- tf.cast(x,dtype,name=None )
- tensorflow tf.logical_and(True, False) tf.logical_not(x, name=None)
- tf.reduce_mean(input,axis=None,keep_dims=False,name=None,reduction_indices=None)
- tf.argmax(input, axis=None, name=None, dimension=None)
- tf.segment_sum(data, segment_ids, name=None)介绍
- tf.pad(input, paddings, name=None) 解析
- tf.nn.atrous_conv2d(value, filters, rate, padding, name=None) {#atrous_conv2d}
- tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None) 除去name参数用以指定该操作的nam
- Python标准库:内置函数__import__(name, globals=None, locals=None, fromlist=(), level=0)
- Python标准库:内置函数property(fget=None, fset=None, fdel=None, doc=None)
- style="display:none"
- remote_loginpasswordfile=NONE
- K-折交叉验证算法
- 基于opencv3的人脸检测
- Android一款可定制的日历控件
- 2017-12-9(转)总结:Unity3D游戏上线后的流程回顾
- spring和mybatis整合方式一
- tensorflow 中tf.gather(params, indices, validate_indices=None, name=None) 函数讲解
- Java基础知识总结
- 2017-12-10杭电OJ2011 《多项式求和》
- 欢迎使用CSDN-markdown编辑器
- ARKit从入门到精通(4)-ARKit全框架API大全
- 前端JavaScript面试技巧全套
- 监控Linq的内部Sql的方法
- EOJ #3452 唐纳德先生和假骰子【暴力】
- 随机森林算法