I trying to modify the following code snippet to not use reshape
a = np.random.randn(1, 2, 3, 5)
b = np.random.randn(2, 5, 10)
np.einsum("ijkl,mjl->kim", a, b.reshape(10,2,5))
At first I thought that the reshape is just transposing the operand, but it seems more complicated than that. Is it possible to do this operation without reshaping?