Skip to content

Commit

Permalink
More if compaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Liddell committed Feb 7, 2024
1 parent 3f7f475 commit 00d0817
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/Dialect/Torch/IR/TorchOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2854,11 +2854,8 @@ OpFoldResult AtenIndexSelectOp::fold(FoldAdaptor adaptor) {
auto indexSizes = indexTy.getSizes();
auto resultSizes = resultTy.getSizes();

if (selfTy.getDtype() != resultTy.getDtype())
return nullptr;
if (selfSizes.size() != resultSizes.size())
return nullptr;
if (indexSizes.size() != 1)
if (selfTy.getDtype() != resultTy.getDtype() ||
selfSizes.size() != resultSizes.size() || indexSizes.size() != 1)
return nullptr;

// If the selection results in a tensor of the same dimensions as the
Expand Down

0 comments on commit 00d0817

Please sign in to comment.