randperm功能是随机打乱一个数字序列。 语法格式: y = torch.randperm(n) y是把1到n这些数随机打乱得到的一个数字序列。
th> torch.randperm(5) 3 1 5 4 2[torch.DoubleTensor of size 5] [0.0003s]th> torch.randperm(7) 7 3 2 5 6 4 1[torch.DoubleTensor of size 7]
本文共 292 字,大约阅读时间需要 1 分钟。
randperm功能是随机打乱一个数字序列。 语法格式: y = torch.randperm(n) y是把1到n这些数随机打乱得到的一个数字序列。
th> torch.randperm(5) 3 1 5 4 2[torch.DoubleTensor of size 5] [0.0003s]th> torch.randperm(7) 7 3 2 5 6 4 1[torch.DoubleTensor of size 7]
转载地址:http://lyhll.baihongyu.com/