Numpy two matrices, pairwise dot product of rows [duplicate]
问题 This question already has answers here : Vectorized way of calculating row-wise dot product two matrices with Scipy (5 answers) Closed 4 years ago . We are currently working on a python project and have to vectorize a lot due to performance constraints. We end up with the following calculation: We have two numpy arrays of shape (20,6) and want to calculate the pairwise dot product of the rows, i.e. we should obtain a (20,1) matrix in the end, where each row is the scalar obtained by the