You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could be wrong here but I don't think its a dot product that is happening here in fn dot.
It's actually a step towards doing a matrix-vector multiplication, if I'm not mistaken.
I say this since its result is not a scalar but a vector of length nelts or rather B.cols/C.cols.
Here's the relevant code section:
# Simplify the code by using the builtin vectorize function
from Functional import vectorize
fn matmul_vectorized_1(C: Matrix, A: Matrix, B: Matrix):
for m in range(C.rows):
for k in range(A.cols):
@parameter
fn dot[nelts : Int](n : Int):
C.store[nelts](m,n, C.load[nelts](m,n) + A[m,k] * B.load[nelts](k,n))
vectorize[nelts, dot](C.cols)
Or have I got it wrong? If I got it right, I could make an issue for it but I just wanted to be sure...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I could be wrong here but I don't think its a dot product that is happening here in
fn dot
.It's actually a step towards doing a matrix-vector multiplication, if I'm not mistaken.
I say this since its result is not a scalar but a vector of length
nelts
or ratherB.cols
/C.cols
.Here's the relevant code section:
Or have I got it wrong? If I got it right, I could make an issue for it but I just wanted to be sure...
Beta Was this translation helpful? Give feedback.
All reactions