Skip to content

Matmul ​

matmul.matmul ​

Signature: matmul.matmul((a, b))

matmul.matmul_backward ​

tensor.matmul_backward — the adjoint da = g·bᵀ, db = aᵀ·g

(the host's MatmulBackward): the last two axes transpose per batch, and each grad is unbroadcast over B back to its operand's shape — a rank-2 or B = 1 operand's grad sums across the broadcast batches.

Signature: matmul.matmul_backward((a, b, g))