Skip to main content



matmul_by_matrix(lhs: Symbol, rhs: Symbol) -> Symbol

Computes the matrix multiplication of two symbolic tensors.

The last two dimensions of each tensor are treated as matricies and multiplied, and the remaining dimensions are broadcast dimensions.


  • lhs (Symbol): The left-hand-side of the matmul.
  • rhs (Symbol): The right-hand-side of the matmul. Must have rank exactly 2.


A symbolic tensor representing he result of broadcasting the two matricies together according to matmul_broadcast and then performing a matrix multiply along the last two dimension of each tensor.