Given two matrices
A: m * r B: n * r
I want to generate another matrix C: m * n, with each entry C_ij being a mat
C: m * n
C_ij
The Einstein notation expresses this problem nicely
In [85]: np.einsum('ac,bd->abcd',A,B) Out[85]: array([[[[ 3, 1], [ 6, 2]], [[ 1, 2], [ 2, 4]]], [[[ 9, 3], [12, 4]], [[ 3, 6], [ 4, 8]]]])