Add tests to verify 0.0 is quantized correctly
We should consider both signed and narrow_range cases. PiperOrigin-RevId: 266167366
This commit is contained in:
parent
4aa7af5ed4
commit
8a94f84e7e
@ -76,7 +76,7 @@ mlir::quant::fakeQuantAttrsToType(Location loc, unsigned numBits, double rmin,
|
|||||||
// points and dequantized to 0.0.
|
// points and dequantized to 0.0.
|
||||||
if (std::fabs(rmax - rmin) < std::numeric_limits<double>::epsilon()) {
|
if (std::fabs(rmax - rmin) < std::numeric_limits<double>::epsilon()) {
|
||||||
return UniformQuantizedType::getChecked(flags, storageType, expressedType,
|
return UniformQuantizedType::getChecked(flags, storageType, expressedType,
|
||||||
1.0, 0, qmin, qmax, loc);
|
1.0, qmin, qmin, qmax, loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine the scale.
|
// Determine the scale.
|
||||||
|
Loading…
Reference in New Issue
Block a user