Let’s say I want to create an (3, 2, 100) tensor where the last dimension is a randomized 100D permutation tensors.
torch.randperm only creates a SINGLE permutation tensor. In order to make a (3, 2, 100) tensor, I would have to create a for loop over dimension 3 and 2. How do I do this in an efficient vectorized way, instead of a very slow for loop?