According to https://github.com/pytorch/pytorch/pull/7873 63, the flip function have been merged in pytorch. I am using version 0.41 and it works for 5D tensor. My 5D tensor is BxCxDxHxW. For flipping, I just use
images=images.flip(4) # flip along 4th dim
images=image.flip(3) # flip along 3rd dim

However, the above functions are equivalent to the vertical and horizontal axis. How could I rotate the tensor 90 degrees or 270 degrees along 3rd or 4th dim?
Thanks!