Skip to content

Commit 5a82ea7

Browse files
author
sushmita
committed
removed extra comments
1 parent bf64631 commit 5a82ea7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Dialect/ONNX/Transforms/DQBinaryQOpt.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "src/Dialect/ONNX/ONNXOps/OpHelper.hpp"
1919
#include "src/Pass/Passes.hpp"
2020
#include "llvm/ADT/STLExtras.h"
21-
#include <cmath> // For std::llround
21+
#include <cmath>
2222
#include <optional>
2323
#include <variant>
2424

@@ -93,8 +93,7 @@ std::optional<T> getScalarTensorValue(ONNXConstantOp constOp) {
9393
return static_cast<T>(*flattenedInt.begin());
9494
}
9595
}
96-
97-
return std::nullopt; // mismatch or more than one unique value
96+
return std::nullopt;
9897
}
9998

10099
template <typename T>
@@ -151,7 +150,6 @@ static mlir::DenseElementsAttr makeScalarDEA(
151150
isSigned ? ((int64_t(1) << (bw - 1)) - 1) : ((int64_t(1) << bw) - 1);
152151
iv = std::min<int64_t>(std::max<int64_t>(iv, minV), maxV);
153152

154-
// Now re-materialize as the *output* ET (which may differ in width/sign).
155153
// This guarantees the result type matches `likeTy`.
156154
if (auto outSigned = outIT.isSigned()) {
157155
// For signed out type, encode iv as signed.
@@ -459,7 +457,6 @@ struct FoldBinaryThroughQDQ : public OpRewritePattern<BinOp> {
459457
return false;
460458
}
461459

462-
// The rounding and state update logic remains the same.
463460
int64_t newZp = (newZpFloat >= 0.0) ? (int64_t)std::floor(newZpFloat)
464461
: (int64_t)std::ceil(newZpFloat);
465462
state.newScale = newScale;

0 commit comments

Comments
 (0)