promptdojo_

Vectors and dot products you can read — step 7 of 7

Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Write matmul(A, B): raise ValueError(f"inner dims {a} != {b}") when the inner dimensions disagree, otherwise every-row-of-A dotted with every-column-of-B. Multiply the (2,3) and (3,2) matrices, print the result and its shape, then show that matmul(B, B) raises — and print the error.

full-screen editor opens — close anytime to keep reading.