promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

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

Checkpoint

One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.

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.