Kind of! My original description was too complicated, hopefully this is a better explanation:
I’d like to generate batches of randomly rotated matrices based on an initial starting matrix (which has dimensions of, for example, [4096, 3]), where the rotation applied to each matrix in the batch is randomly chosen from a group of rotation matrices (in my code in the original post, I only want to randomly select from 8 possible rotation angles). Therefore, what I end up with is a tensor of shape [batch_size, 4096, 3].
My current approach is that I pre-make the possible rotated matrices (since I’m only dealing with 8 possible random rotations), and then use a for loop to generate the batch by randomly picking one of the eight pre-made rotated matrices for each item in the batch. This isn’t super efficient, so I was hoping to vectorize the whole process somehow.
Please let me know if that clarifies my question at all, or if I’m still being too confusing.