Skip to content

Commit

Permalink
Fix onnx.If lowering with scalar condition tensor (#3846)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchen62 authored Nov 1, 2024
1 parent 25738b8 commit 032a636
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Conversion/TorchOnnxToTorch/DefaultDomainGtoP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void mlir::torch::onnx_c::populateDefaultDomainGtoP(

auto conditionType =
cast<Torch::ValueTensorType>(conditionTensor.getType());
if (!conditionType || conditionType.getSizes().size() != 1)
if (!conditionType || conditionType.getSizes().size() > 1)
return rewriter.notifyMatchFailure(
binder.op, "condition must have one single element per "
"https://onnx.ai/onnx/operators/onnx__If.html");
Expand Down

0 comments on commit 032a636

Please sign in to comment.