Tensorflow 1.0 函数示例

tf.nn.top_k

  • 返回最后一个维度上的top-k个值及其位置
  • val idx的维度均为【input.shape[:-1], k】
Tensorflow 1.0 函数示例_第1张图片
Paste_Image.png

tf.slice

  • 从begin开始,取一个大小为size的张量
Tensorflow 1.0 函数示例_第2张图片
Paste_Image.png

tf.gather

  • 按照 indices从params中选取
  • 输出维度为【len(indices), params[1:]】
  • 下图将a中的shape[0]中的[1,2]取出来
Tensorflow 1.0 函数示例_第3张图片
Paste_Image.png
Tensorflow 1.0 函数示例_第4张图片
Paste_Image.png
Tensorflow 1.0 函数示例_第5张图片
Paste_Image.png

你可能感兴趣的:(Tensorflow 1.0 函数示例)