E7001

E7001 — Matmul dimension mismatch

What the compiler reports

E7001 … inner dimensions

The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.

A program that triggers it

//
// Part of the Vx Project, under the Apache License v2.0 with LLVM Exceptions.
// See LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// `[m, k] @ [k, n]` requires the two `k`s to agree. The checker used to compare
// element types and ranks only, so this compiled clean and the AST path sized a
// result at run time and multiplied across mismatched extents (Vx#397).
//

fn main() -> i32 {
  let mut a : Tensor<f32, [2, 3]> = Tensor<f32, [2, 3]>::uninit();
  let mut b : Tensor<f32, [4, 5]> = Tensor<f32, [4, 5]>::uninit();
  a[0][0] = 1.0;
  b[0][0] = 1.0;
  let c = a @ b;
  return 0;
}

From tests/frontend/fail/matmul_inner_dimension_disagreement.vx, which asserts this diagnostic on every commit.

Related