tf.nn.top_k
- 返回最后一个维度上的top-k个值及其位置
- val idx的维度均为【input.shape[:-1], k】

Paste_Image.png
tf.slice
- 从begin开始,取一个大小为size的张量

Paste_Image.png
tf.gather
- 按照 indices从params中选取
- 输出维度为【len(indices), params[1:]】
- 下图将a中的shape[0]中的[1,2]取出来

Paste_Image.png

Paste_Image.png

Paste_Image.png