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]
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]
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。