I tried einsum np.einsum but this is giving me error that the output cannot have same letters repeated.
np.einsum('aij,aj->aa', vector1, vector2)
Also tried np.dot method but that attempt is also futile.
(Broadcasting might be having an answer for this.)
Tried
np.sum(vector1[:,np.newaxis] * vector2, axis=axis)
But, this is also giving me an error Here are the vectors 1 and 2
vector1 = np.arange(12).reshape((4,1,3))
vector2 = np.arange(12).reshape((4,3))
Thank you everyone for the comments.Apologies for asking the question incorrectly. (I needed n,n shape rather than n,3).
I am able to achieve it in the following way: np.einsum(‘ijk,bk->ib’,vector1,vector2)
np.einsum('aij,aj->aj', vector1, vector2)?A[:,0,:] *Bwould produce a (n,3) result without any sum's.einsum('aij,aj->aj'will useA.sum(axis=1) * B. Neither is a dot product.