PyTorch——(4)where条件判断、gather查表

where() 条件判断

在这里插入图片描述在这里插入图片描述

gather()查表

在这里插入图片描述
input :待查的表
dim : 在input的哪个维度上查表
index: 待查表的索引值
在这里插入图片描述

原文地址:https://www.cnblogs.com/long5683/p/14702028.html