torch:matmul
(torch:matmul a b)
Differentiable matrix product with torch.matmul's rank rules: two vectors give the dot product (a scalar tensor), a matrix and a vector the usual products, and rank >= 3 on either side the batched product (linalg:matmul: the last two axes are the matrix, leading axes broadcast). Gradients flow to both operands -- g . b^T and a^T . g in the matrix case -- with batch axes summed back like every broadcasting adjoint.