diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp --- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp +++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp @@ -101,6 +101,9 @@ //===----------------------------------------------------------------------===// static bool hasZeroDimension(ShapedType shapedType) { + if (!shapedType.hasRank()) + return false; + auto rank = shapedType.getRank(); for (int i = 0; i < rank; i++) { @@ -113,7 +116,8 @@ return false; } -template static LogicalResult verifyConvOp(T op) { +template +static LogicalResult verifyConvOp(T op) { // All TOSA conv ops have an input() and weight(). auto inputType = llvm::dyn_cast(op.getInput().getType()); auto weightType = llvm::dyn_cast(op.getWeight().getType());