[Torch Dialect] Fix small bugs in decompose-complex-ops pass, e.g. missing return sentence (#2409)

pull/2414/head snapshot-20230822.938
Jiawei Wu 2023-08-22 09:56:11 +08:00 committed by GitHub
parent 4c9d234b01
commit b552d4ed95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1292,8 +1292,8 @@ public:
SmallVector<Value> unsqueezedSizes, expandedSizes, reshapedSizes;
SmallVector<int64_t> unsqueezedIntSizes, expandedIntSizes;
assert(repeats.size() >= rank && "leadingRank should greater than 0");
auto leadingRank = repeats.size() - rank;
assert(leadingRank >= 0 && "leadingRank should greater than 0");
for (size_t i = 0; i < leadingRank; ++i) {
insertDimSizes(unsqueezedSizes, unsqueezedIntSizes, ArrayRef<Value>{one});
insertDimSizes(expandedSizes, expandedIntSizes,
@ -4808,7 +4808,7 @@ public:
int64_t inputRank = inputSizes.size();
auto outputType = op.getType().cast<BaseTensorType>();
if (!outputType.hasSizes()) {
rewriter.notifyMatchFailure(
return rewriter.notifyMatchFailure(
op, "only output with shape information is supported");
}
auto outputRank = outputType.getSizes().size();