I have two 2-d numpy arrays with the same dimensions, A and B, and am trying to calculate the row-wise dot product of them. I could do:
np.sum(A * B, axis=1)
Is there another way to do this so that numpy is doing the row-wise dot product in one step rather than two? Maybe with tensordot
?