If it’s on CPU then the simplest way seems to be just converting the tensor to numpy array and use in place shuffling :
t = torch.arange(5)             
np.random.shuffle(t.numpy())
print(t) 
# tensor([0, 2, 3, 1, 4])