Get values between item from LongTensor

Is there an efficient way of getting tensor of items between two values in a LongTensor
For example

#input
x = torch.LongTensor([0,2,3,5,1,4,2,7,1,8])

#output
x = [torch.LongTensor([3,5]), 
torch.LongTensor([7])
]

In the example above I want to get the values between 2 and 1 into a new tensor. Is there any method in pytorch for this? or any efficient way?