tf.nn.top_k
- 返回最后一个维度上的top-k个值及其位置
- val idx的维度均为【input.shape[:-1], k】
![](https://img.haomeiwen.com/i2236431/02cc0091fe9657e0.png)
tf.slice
- 从begin开始,取一个大小为size的张量
![](https://img.haomeiwen.com/i2236431/5a06c7e79bdd290a.png)
tf.gather
- 按照 indices从params中选取
- 输出维度为【len(indices), params[1:]】
- 下图将a中的shape[0]中的[1,2]取出来
![](https://img.haomeiwen.com/i2236431/4ec23bf35bde2ea5.png)
![](https://img.haomeiwen.com/i2236431/0cf249914e3a24b6.png)
![](https://img.haomeiwen.com/i2236431/a4203e37dbfb9a55.png)
本文标题:Tensorflow 1.0 函数示例
本文链接:https://www.haomeiwen.com/subject/lhkizttx.html
网友评论