Skip to content

Commit

Permalink
[onnx] Fix shortcircuit path
Browse files Browse the repository at this point in the history
The implementation was short circuiting the second result. Updated to
guarantee we do not short circuit.
  • Loading branch information
rsuderman committed Aug 14, 2024
1 parent 64b0d4a commit 365e1cd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@ LogicalResult OnnxRnnExpander(OpBinder binder,

// Result types
ValueTensorType yTy, Y_hType;
if (binder.tensorResultTypeAtIndex(yTy, 0) &&
binder.tensorResultTypeAtIndex(Y_hType, 1)) {
auto hasResult0 = binder.tensorResultTypeAtIndex(yTy, 0);
auto hasResult1 = binder.tensorResultTypeAtIndex(Y_hType, 1);

if (hasResult0 && hasResult1) {
return rewriter.notifyMatchFailure(binder.op,
"At least one output must be present");
}
Expand Down

0 comments on commit 365e1cd

Please sign in to comment.