Skip to content

Commit

Permalink
[ONNX] Delete redundant dynamic dim check for result types (#3942)
Browse files Browse the repository at this point in the history
The dynamic has been supported by the code, the check is useless and will block the 
dynamic examples. This will fix nod-ai/SHARK-ModelDev#893
  • Loading branch information
AmosLewis authored Jan 7, 2025
1 parent fee88fd commit 356540a
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4487,11 +4487,6 @@ void mlir::torch::onnx_c::populateDefaultDomainQtoZ(
SmallVector<Type> scanOutTypes;
for (unsigned i = numInits; i < resultTypes.size(); i++) {
auto scanOutTy = cast<Torch::ValueTensorType>(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,
Expand Down

0 comments on commit 356540a

Please sign in to comment.