On 22 August 2017 at 12:59, Oliver Lemke <oliver.le...@uni-hamburg.de> wrote: > Hi Gerrit, > > Why is it necessary to replace .T with .swapaxes? Could you give an example > were the former fails but the latter works?
K.T swaps indexes 0 and 1, but matmul broadcasts along indices -1 and -2, so those are the axes I need to swap to get the correct behaviour: https://docs.scipy.org/doc/numpy/reference/generated/numpy.matmul.html "If either argument is N-D, N > 2, it is treated as a stack of matrices residing in the last two indexes and broadcast accordingly." regards, Gerrit. _______________________________________________ typhon.mi mailing list typhon.mi@lists.uni-hamburg.de https://mailman.rrz.uni-hamburg.de/mailman/listinfo/typhon.mi