How to form a sequence of consecutive numbers in Pytorch?
How to convert the Matlab code
v = [1: n]

to pytorch?
Writing a whole loop for that seems inefficient.

You can directly use the arange method from Pytorch.

torch_v = torch.arange(1,n)


Reference: https://pytorch.org/docs/master/torch.html?highlight=arange#torch.arange
