diff --git a/mlir/lib/IR/BuiltinAttributes.cpp b/mlir/lib/IR/BuiltinAttributes.cpp --- a/mlir/lib/IR/BuiltinAttributes.cpp +++ b/mlir/lib/IR/BuiltinAttributes.cpp @@ -459,6 +459,8 @@ // Verify that the rank of the indices matches the held type. auto rank = type.getRank(); + if (rank == 0 && index.size() == 1 && index[0] == 0) + return true; if (rank != static_cast(index.size())) return false;