[Mlir-commits] [mlir] Sub-channel quantized type implementation (PR #120172)

Kevin Gleason llvmlistbot at llvm.org
Tue Feb 11 14:55:23 PST 2025


================
@@ -81,27 +168,34 @@ LogicalResult verifyQuantizationOp(Operation *op, QuantizedType quantizedType,
         "expressed type in quantized type expected to match float type");
 
   // Veriy integrity of per-axis quantization information, if present.
-  return verifyPerAxisQuantization(op, quantizedType, containerType);
-}
+  if (auto quantizedPerAxisType =
+          dyn_cast<UniformQuantizedPerAxisType>(quantizedType)) {
+    return verifyPerAxisQuantization(op, quantizedPerAxisType, containerType);
+  } else if (auto quantizedSubChannelType =
+                 dyn_cast<UniformQuantizedSubChannelType>(quantizedType)) {
+    return verifySubChannelQuantization(op, quantizedSubChannelType,
+                                        containerType);
+  }
 
-}  // namespace
+  return success();
----------------
GleasonK wrote:

Also prefer two `if` stmts instead of the `else if`, comment below with description

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


More information about the Mlir-commits mailing list