Hi LeviViana,
Thanks for getting to me so quickly. However, I think maybe I didn’t express my question clearly. I was hoping to find the implementation for permutation, as in:
a = a.permute(2, 0, 1),
where a is a 3D PyTorch tensor, and the code permute a’s dimensions such that the inner most dimension (2) is changed to the outer most (0).
the code is equivalent to code like this:
a = a.transpose(1, 2).transpose(0, 1).contiguous()
The code you pointed out seems to be for random permutations, not permutations of dimensions, if I understood it correctly.
Fei