mirror of https://github.com/llvm/torch-mlir
[onnx] Fix shortcircuit path (#3633)
The implementation was short circuiting the second result. Updated to guarantee we do not short circuit.pull/3644/head
parent
3a599bec80
commit
78deb175b3
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue