Transposing flips a matrix over its diagonal: row i becomes column i. An m × n matrix comes back as n × m.
Task: write transpose(matrix) that takes a list of rows and returns the transposed matrix, also as a list of rows.
This shows up constantly once you start writing gradients by hand.
X @ WneedsX.Tto get the gradient with respect toW— the shapes only line up one way, and transpose is what lines them up.
Once your code passes every test, a reference solution shows up here so you can compare it with yours.
Drag a cell in M. Transposing doesn't just relabel — it can change how many vectors you have, and how many dimensions each one has.
M's 3 columns were 2D vectors in a plane. Mᵀ's 2 columns (M's old rows) are 3D vectors in space — transposing changed both the count and the dimension.