[onnx] Fix shortcircuit path (#3633)

The implementation was short circuiting the second result. Updated to
guarantee we do not short circuit.
pull/3644/head
Rob Suderman 2024-08-16 09:23:47 -07:00 committed by GitHub
parent 3a599bec80
commit 78deb175b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -229,8 +229,10 @@ LogicalResult OnnxRnnExpander(OpBinder binder,
// Result types // Result types
ValueTensorType yTy, Y_hType; ValueTensorType yTy, Y_hType;
if (binder.tensorResultTypeAtIndex(yTy, 0) && auto hasResult0 = binder.tensorResultTypeAtIndex(yTy, 0);
binder.tensorResultTypeAtIndex(Y_hType, 1)) { auto hasResult1 = binder.tensorResultTypeAtIndex(Y_hType, 1);
if (hasResult0 && hasResult1) {
return rewriter.notifyMatchFailure(binder.op, return rewriter.notifyMatchFailure(binder.op,
"At least one output must be present"); "At least one output must be present");
} }