Skip to content

Commit

Permalink
Fix issues to compile Yolov3-12. (#1726)
Browse files Browse the repository at this point in the history
Stop conversion to enable onnx.LeakyRelu on NNPA when the stickified layouts of input and output are not the same.
Signed-off-by: Yasushi Negishi <[email protected]>
  • Loading branch information
negiyas authored Sep 26, 2022
1 parent df104fb commit 20667cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Accelerators/NNPA/Dialect/ZHigh/ZHighCombine.td
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def SigmoidLayoutChangingPattern : Pat<
// - %X should have static shape, and %alpha should be constant.
//
def ReplaceONNXLeakyReluPattern: Pat<
(ZHighStickOp (ONNXLeakyReluOp:$out (ZHighUnstickOp $X), $alpha),
(ZHighStickOp:$stickout (ONNXLeakyReluOp:$out (ZHighUnstickOp $X), $alpha),
$layout),
(ZHighSubOp
(ZHighReluOp $X, (returnType $X)),
Expand All @@ -166,7 +166,8 @@ def ReplaceONNXLeakyReluPattern: Pat<
$layout),
(returnType $X)),
(returnType $X))),
[(IsStaticShapeTensor $X), (IsPlusConstantFloat $alpha)]
[(IsStaticShapeTensor $X), (IsPlusConstantFloat $alpha),
(SameLayout $X, $stickout)]
>;

#endif // ZHIGH_COMBINE

0 comments on commit 20667cd

Please sign in to comment.