range函数

th> a=torch.range(1,5)
                                                                      [0.0001s]
th> a
 1
 2
 3
 4
 5
[torch.DoubleTensor of size 5]

                                                                      [0.0002s]
th> a=torch.range(1,5,2)
                                                                      [0.0001s]
th> a
 1
 3
 5
[torch.DoubleTensor of size 3]
原文地址:https://www.cnblogs.com/ymjyqsx/p/6226215.html