Rotate and Mirror Operations
For data augmentation, it's very useful to have operations to mirror and rotate a tensor. See PyTorch's flip and rot90 methods.
Note that this isn't super urgent, as I've figured out I can achieve all combinations of flips and rotates with gathers and permutes.
Specifically, this will mirror the first dimension:
let flip_gather: Tensor<Rank1<Dim0>, usize, _, _> = dev.tensor((0..Dim0).rev().collect::<Vec<usize>>());
let tensor = tensor.gather(flip_gather);
And this will rotate 90 degrees and mirror the second dimension:
let tensor = tensor.permute::<_, Axes2<1, 0>>()
And if you alternate between these two operations, you will cycle through all 8 possible combinations of rotates and mirrors on the first two axes. And you can use permutes to make sure the relevant axes are the first two, and then permute back afterwards.
But in the long run, I think having explicit mirror and rotate operations would be much more intuitive.
Ooh nice work arounds! rotate is super useful for augmentations in image classification so definitely want to add these