I would like to perform a series of rotations with mxm arrays on a series nxm matrices in a vectorized fashion (1000xmxm dot 1000xnxm --> 1000xnxm). This question seems to have the answer if my nxm matrices were 1xm vectors, but unfortunately they are not. I was wondering if there is an einsum that I could use, or some other matrix manipulation to not have to loop over 1000 times.
Asked
Active
Viewed 145 times
0
-
Where does the `13` come from? In a `dot` one pair of dimensions is summed? Which is in your case. With several sets of `3` it's ambiguous. The default behavior for `dot` and `matmul` is last dimension of `A` with the 2nd to the last of `B`. – hpaulj Mar 14 '19 at 21:53
-
Yes, sorry I have edited for clarity both the title and the notation to make this less ambiguous. – sealpancake Mar 14 '19 at 21:57
-
Just swap the factors? `M1000nm@M1000mm`? – Paul Panzer Mar 14 '19 at 21:58
-
'kij,kni->knj' or 'kij,knj->kni', summing either on the `i` or the `j` – hpaulj Mar 14 '19 at 22:00
-
@hpaulj That worked within a transpose, thanks so much! – sealpancake Mar 14 '19 at 22:31
-
You can change the order of dimensions on the output, 'knj` to 'kjn' or whatever works. – hpaulj Mar 14 '19 at 23:09