Skip to content

Commit 3572831

Browse files
committed
fix: clearer comment for calculating dequantized value
1 parent b5eacf6 commit 3572831

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Dialect/ONNX/ONNXOps/OpHelper.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,10 @@ bool hasIntegerPowerExponent(ONNXPowOp *op, int64_t &exponentValue) {
813813
auto zeroPoint =
814814
getScalarValue<double>(zeroPointAttr, zeroPointAttr.getElementType());
815815

816-
// Calculate dequantized value for exponent
816+
// Calculate dequantized value for exponent (This is an approximation and
817+
// isn't expected to match the actual calculation done by the
818+
// DequantizeLinear op. However, it should be good enough for checking that
819+
// the exponent is an integer)
817820
double dequantizedExponent = (x - zeroPoint) * scale;
818821

819822
if (dequantizedExponent == ceil(dequantizedExponent)) {

0 commit comments

Comments
 (0)