randperm函数
生活随笔
收集整理的這篇文章主要介紹了
randperm函数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 直接在电脑上使用安卓系统
- 下一篇: 技巧之 -- 8 的倍数