I'm trying to compute the row-wise outer-product between two matrices in theano, without using scan. I can do this in numpy by using einsum, which isn't available in theano.
A = np.array([[1,1,1],[2,2,2]])
B = np.array([[3,3,3,3],[4,4,4,4]])
print np.einsum('xi,xj->xij', A, B)
[[[3 3 3 3]
[3 3 3 3]
[3 3 3 3]]
[[8 8 8 8]
[8 8 8 8]
[8 8 8 8]]]