Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions mlir/lib/Dialect/Quant/IR/QuantTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,6 @@ LogicalResult UniformQuantizedType::verifyInvariants(
// Verify scale.
double minScale = getMinScale(expressedType);
double maxScale = getMaxScale(expressedType);
if (scale <= 0.0 || std::isinf(scale) || std::isnan(scale))
return emitError() << "illegal scale: " << scale;
if (scale < minScale || scale > maxScale)
return emitError() << "scale out of expressed type range [" << minScale
<< ", " << maxScale << "]";
Expand Down Expand Up @@ -388,8 +386,6 @@ LogicalResult UniformQuantizedPerAxisType::verifyInvariants(
double minScale = getMinScale(expressedType);
double maxScale = getMaxScale(expressedType);
for (double scale : scales) {
if (scale <= 0.0 || std::isinf(scale) || std::isnan(scale))
return emitError() << "illegal scale: " << scale;
if (scale < minScale || scale > maxScale)
return emitError() << "scale out of expressed type range [" << minScale
<< ", " << maxScale << "]";
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Dialect/Quant/parse-uniform-invalid.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

// -----
// Illegal scale: negative
// expected-error@+1 {{illegal scale: -1.000000}}
// expected-error@+1 {{scale out of expressed type range}}
!qalias = !quant.uniform<i8<-4:3>:f32, -1.0:127>

// -----
Expand Down
Loading