I have two numy matrices :
- A with shape (N,M,d)
- B with shape (N,d)
So, I am trying to get a Matrix with shape (N,M,d) in such manner that I do element wise product between B and each element of A (which are M elements). I used numpy's einsum as follows :
product = np.einsum('ijk,ik->ijk', A, B)
I GET THE GOOD shape but I suspect that the operation is wrong and that I am not doing element wise product as intended.
Is my use of einsum correct ?
A * B[:, None, :]if you're not sure.