Dec-10-2022, 09:23 AM
I have the following numpy arrays:
A of size (MxK)
B of size (MxN)
How to multiply A and B to get a matrix of size (MxKxN)?
I tried with A * B and somebody suggested A[:,None]*B. But that doesn't give what I need.
To be clear, I want to generate c[i,j,k] = a[i,j]*b[i,k].
I apologize that the question is somewhat basic, as I am a beginner.
A of size (MxK)
B of size (MxN)
How to multiply A and B to get a matrix of size (MxKxN)?
I tried with A * B and somebody suggested A[:,None]*B. But that doesn't give what I need.
To be clear, I want to generate c[i,j,k] = a[i,j]*b[i,k].
I apologize that the question is somewhat basic, as I am a beginner.