Skip to content

Commit

Permalink
[Torch Dialect] Fix small bugs in decompose-complex-ops pass, e.g. mi…
Browse files Browse the repository at this point in the history
…ssing return sentence (#2409)
  • Loading branch information
Vremold authored Aug 22, 2023
1 parent 4c9d234 commit b552d4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,8 +1292,8 @@ class DecomposeAtenRepeatOp : public OpRewritePattern<AtenRepeatOp> {

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,
Expand Down Expand Up @@ -4808,7 +4808,7 @@ class DecomposeAtenIndexTensorOp : public OpRewritePattern<AtenIndexTensorOp> {
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();
Expand Down

0 comments on commit b552d4e

Please sign in to comment.