MLIR
20.0.0git
|
Reference implementation of converting between real numbers and values represented by a UniformQuantizedType. More...
#include "mlir/Dialect/Quant/Utils/UniformSupport.h"
Public Member Functions | |
UniformQuantizedValueConverter (UniformQuantizedType uniformType) | |
UniformQuantizedValueConverter (double scale, double zeroPoint, double clampMin, double clampMax, uint32_t storageBitWidth, bool isSigned) | |
UniformQuantizedValueConverter (double scale, double zeroPoint, const APFloat &clampMin, const APFloat &clampMax, uint32_t storageBitWidth, bool isSigned) | |
virtual APInt | quantizeFloatToInt (APFloat expressedValue) const |
int64_t | quantizeFloatToInt64 (APFloat expressedValue) const |
virtual | ~UniformQuantizedValueConverter ()=default |
Reference implementation of converting between real numbers and values represented by a UniformQuantizedType.
Note that this is not expected to be speedy and may be superseded eventually by a more optimal implementation. Also, the interface assumes that quantization is done per-layer and will need to be wider for various per-channel schemes. As such, this is a placeholder.
Definition at line 61 of file UniformSupport.h.
|
inlineexplicit |
Definition at line 63 of file UniformSupport.h.
|
inline |
Definition at line 74 of file UniformSupport.h.
|
inline |
Definition at line 83 of file UniformSupport.h.
|
virtualdefault |
References max(), min(), and mlir::presburger::round().
|
inlinevirtual |
Definition at line 94 of file UniformSupport.h.
Referenced by quantizeFloatToInt64().
|
inline |
Definition at line 121 of file UniformSupport.h.
References quantizeFloatToInt().