摘要: 定义 torch.sort(input,dim,descending) torch.argsort(input,dim,descending) 用法 torch.sort:对输入数据排序,返回两个值,即排序后的数据values和其在原矩阵中的坐标indices torch.argsort:同torc 阅读全文
posted @ 2022-09-01 20:18 SXQ-BLOG 阅读(720) 评论(0) 推荐(0) 编辑
摘要: 形式: torch.max(input) → Tensor 返回输入tensor中所有元素的最大值: a = torch.randn(1, 3) >>0.4729 -0.2266 -0.2085 torch.max(a) #也可以写成a.max() >>0.4729 形式: torch.max(in 阅读全文
posted @ 2022-09-01 08:38 SXQ-BLOG 阅读(762) 评论(0) 推荐(0) 编辑
摘要: https://pytorch.org/docs/stable/generated/torch.nonzero.html 阅读全文
posted @ 2022-09-01 08:36 SXQ-BLOG 阅读(21) 评论(0) 推荐(0) 编辑