Most efficient way to rotate a 1000x3 tensor of coordinates?

Hi! If I have a tensor that has the shape, say, [1000, 3], where each row is an x, y, z point, I was wondering what the most efficient way would be in PyTorch to apply a rotation to each of these points and get a transformed [1000, 3] tensor?

In what form do you have the rotation available? Is it supposed to be a special type of rotation (e.g. only around the z axis) or any general rotation in 3D?

My suspicion is that as soon as you have more than a few points, the best thing is to create the 3x3 rotation matrix and perform a matrix multiplication on the tensor.

1 Like

Just any general rotation. Matrix multiplication makes sense, thank you!