Skip to content

Commit

Permalink
Merge branch 'feature/onnx-to-tosa' into tina.FXML-3548-bump-onnx-mli…
Browse files Browse the repository at this point in the history
…r-to-c03bc49b430014c6d1ae850de50295c99974cc57
  • Loading branch information
TinaAMD committed Feb 5, 2024
2 parents e9fb456 + 740e34e commit c0ccda1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Conversion/ONNXToKrnl/Math/Reduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,15 @@ struct ONNXReductionOpLowering : public OpConversionPattern<ONNXReductionOp> {
llvm::BitVector litAxes(inRank, false);
if (hasNoAxes) {
if (isNoop) {
// No axes and is noop, should we not just return the input array?
} else {
// No axes, perform a full reduction.
for (int64_t i = 0; i < inRank; ++i) {
uniqueLitAxes.push_back(i);
litAxes[i] = true;
}
// Axes is none and 'noop_with_empty_axes' is true. This behaves as a
// noop, replace op with its input
rewriter.replaceOp(op, adaptor.getData());
return success();
}
// No axes, perform a full reduction.
for (int64_t i = 0; i < inRank; ++i) {
uniqueLitAxes.push_back(i);
litAxes[i] = true;
}
} else if (!dynamicAxes) {
// Check raw axes.
Expand Down

0 comments on commit c0ccda1

Please sign in to comment.