File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
src/Dialect/ONNX/Transforms Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 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
10099template <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;
You can’t perform that action at this time.
0 commit comments