[Mlir-commits] [mlir] [mlir[tosa] Switch zero point of avgpool2d to input variable type (PR #128983)

Tai Ly llvmlistbot at llvm.org
Fri Feb 28 06:58:38 PST 2025


================
@@ -629,27 +643,37 @@ static void buildMatMulOpWithQuantInfo(OpBuilder &builder,
 }
 
 /// Both the tosa.avg_pool2d and unary ops use the same
-/// UnaruOpQuantizationAttr but avg_pool operator has its own builder as it
+/// UnaryOpQuantizationAttr but avg_pool operator has its own builder as it
 /// has additional parameters not part of the unary ops.
 static void
 buildAvgPool2dOpWithQuantInfo(OpBuilder &builder, OperationState &result,
                               Type outputType, Value input,
                               DenseArrayAttr kernel, DenseArrayAttr stride,
                               DenseArrayAttr pad, TypeAttr accType) {
-  result.addOperands(input);
+  const Location loc{result.location};
+  int64_t inputZp{0};
+  int64_t outputZp{0};
+
+  auto quantAttr = buildUnaryOpQuantizationAttr(builder, input, outputType);
----------------
Tai78641 wrote:

done

https://github.com/llvm/llvm-project/pull/128983


More information about the Mlir-commits mailing list