From 356540afd7c0a9fc5bbef888acbad37648aade94 Mon Sep 17 00:00:00 2001 From: Chi_Liu <22491986+AmosLewis@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:09:30 -0800 Subject: [PATCH] [ONNX] Delete redundant dynamic dim check for result types (#3942) The dynamic has been supported by the code, the check is useless and will block the dynamic examples. This will fix https://github.com/nod-ai/SHARK-ModelDev/issues/893 --- lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp b/lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp index 963a5cfe419c..5fb17c79a65b 100644 --- a/lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp +++ b/lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp @@ -4487,11 +4487,6 @@ void mlir::torch::onnx_c::populateDefaultDomainQtoZ( SmallVector scanOutTypes; for (unsigned i = numInits; i < resultTypes.size(); i++) { auto scanOutTy = cast(resultTypes[i]); - // TODO: Handle dynamic result types. - if (!scanOutTy.hasSizes() || !scanOutTy.areAllSizesKnown()) { - return rewriter.notifyMatchFailure( - binder.op, "Expects result type to be static"); - } Value sizeList = createConstantIntList(binder, rewriter, scanOutTy.getSizes()); initVals.push_back(Torch::createInitTensor(rewriter, loc, scanOutTy,