Skip to content

Commit d1993ab

Browse files
committed
relax negative scale conditions
1 parent b3ccdd1 commit d1993ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir/lib/Dialect/Quant/IR/QuantTypes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ LogicalResult UniformQuantizedType::verify(
299299
return emitError() << "expressed type must be floating point";
300300

301301
// Verify scale.
302-
if (scale <= 0.0 || std::isinf(scale) || std::isnan(scale))
302+
if (std::isinf(scale) || std::isnan(scale))
303303
return emitError() << "illegal scale: " << scale;
304304

305305
return success();
@@ -364,7 +364,7 @@ LogicalResult UniformQuantizedPerAxisType::verify(
364364

365365
// Verify scale.
366366
for (double scale : scales) {
367-
if (scale <= 0.0 || std::isinf(scale) || std::isnan(scale))
367+
if (std::isinf(scale) || std::isnan(scale))
368368
return emitError() << "illegal scale: " << scale;
369369
}
370370

0 commit comments

Comments
 (0)