pytorch技巧1: 数组排序后复原
pytorch用法1: 数组排序后复原主要是利用torch.sort函数里返回的第二个参数index,这个index表示的是排序后的数字在原来数组中的位置。比如:l = torch.randint(10,(10,))a, idx1 = torch.sort(l)结果为:l: tensor([3., 3., 8., 7., 9., 9., 7., 4., 5., 1.])a: ten...
原创
2019-03-18 21:52:58 ·
5313 阅读 ·
1 评论