Reputation: 15
I have 2 matrices. Say A of size 6610 and B of size 610. What I want to do is multiply the 10 66 matrices of A with the 10 6 element vectors of B to give a 6*10 matrix. Is there a way to do this without using a loop?
What I want is
A = np.ones((6,6,10))
B = np.ones((6,10))
mat = np.zeros((6,10))
for i in range(10):
mat[:,i] = A[:,:,i]@B[:,i]
but without the for loop.
Upvotes: 1
Views: 55