diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp index c8e9ad8bd3346..1b73158cd7041 100644 --- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp +++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp @@ -600,6 +600,11 @@ LogicalResult tosa::AvgPool2dOp::verify() { if (inputETy.isF32() && !accType.isF32()) return emitOpError("accumulator type for f32 tensor is not f32"); + if ((llvm::isa(inputETy) || + llvm::isa(inputETy)) && + !accType.isF16()) + return emitOpError("accumulator type for f8 tensor is not f16"); + if (inputETy != inputZpETy) return emitOpError("expect both input and its zero point are the same " "element type, got ")