Suppose I have an array X
of shape (B, N, N, 3, 3). I want to vectorise the operation
X[:,0,...] @ X[:,1,...] ... @ X[:,N-1,...]
How can I vectorise this in numpy? I don’t want to use for loops.
I tried using einsum, but it didn’t work for me, it ended up summing the matrices.
New contributor
rick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.