您的位置: 首页 > 文章 > torch.where(),torch.gather() torch.where(),torch.gather() 分类: 文章 • 2023-04-06 20:44:23 torch.where() 给定一个条件cond,满足条件的取x对应位置元素,不满足的取y对应元素 torch.gather() 实际上是一个查表操作 先计算出满足条件的索引index,再利用得到的index从需要查找的数据中进行查找