[Mlir-commits] [mlir] [mlir][tosa] Convert RESCALE op multiplier and shift from attributes to inputs (PR #129720)

Luke Hutton llvmlistbot at llvm.org
Wed Mar 5 03:19:47 PST 2025


================
@@ -2469,6 +2468,139 @@ LogicalResult TransposeConv2DOp::verify() {
   return success();
 }
 
+LogicalResult RescaleOp::verify() {
+  auto inputType = llvm::dyn_cast<ShapedType>(getInput().getType());
+  if (!inputType) {
+    emitOpError("expect shaped tensor for input, got ") << getInput().getType();
+    return failure();
+  }
+  auto inputElementType = inputType.getElementType();
+  if (auto inputQType =
+          llvm::dyn_cast<quant::QuantizedType>(inputElementType)) {
+    inputElementType = inputQType.getStorageType();
----------------
lhutton1 wrote:

There's a utility function that can help with this: `getStorageElementTypeOrSelf`

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


More information about the Mlir-commits mailing list