MLIR 22.0.0git
QuantUtils.h File Reference

Go to the source code of this file.

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::tosa

Functions

bool mlir::tosa::computeMultiplierAndShift (double scale, int32_t &multiplier, int32_t &shift, int32_t scaleWidth)
 From a scale value, computes multiplier and shift values for 16 or 32-bit scale widths.
template<typename IntType>
Value mlir::tosa::getConstTensorInt (OpBuilder &builder, Location loc, ArrayRef< IntType > vec)
ConvOpQuantizationAttr mlir::tosa::buildConvOpQuantizationAttr (OpBuilder &builder, Value input, Value weight)
 Method to build ConvOpQuantizationAttr, called from ConvOpQuantInfoBuilder/TransConvOpQuantInfoBuilder: input_zp: input zeropoint weight_zp: weight zeropoint.
std::pair< Value, Valuemlir::tosa::createZPsAsConst (OpBuilder &builder, Value input, Value weight)
MatMulOpQuantizationAttr mlir::tosa::buildMatMulOpQuantizationAttr (OpBuilder &builder, Value a, Value b)
 Builds MatMulOpQuantizationAttr, called from MatMulOpQuantInfoBuilder: aZp: input a zeropoint bZp: input b zeropoint.
UnaryOpQuantizationAttr mlir::tosa::buildUnaryOpQuantizationAttr (OpBuilder &builder, Value input, Type outputRawType)
 Builds UnaryOpQuantizationAttr UnaryOpQuantInfoBuilder: inputZp: input zeropoint outputZp: output zeropoint.
PadOpQuantizationAttr mlir::tosa::buildPadOpQuantizationAttr (OpBuilder &builder, Value input)
 Builds PadOpQuantizationAttr, called from PadOpQuantInfoBuilder: inputZp: input zeropoint.
Type mlir::tosa::buildConvOpResultTypeInfo (OpBuilder &builder, Type outputType, Value input, Value weight)
 construct ConvOp output type with correct bitwidth based on input/weight width.
Type mlir::tosa::buildQTypeFromMinMax (OpBuilder builder, Type inputDType, Attribute minAttr, Attribute maxAttr, IntegerAttr quantBits, int filterQuantDim, bool isSigned, BoolAttr narrowRange)
 Builds Tosa quantization attributes from min/max values.
TypeAttr mlir::tosa::buildQTypeAttrFromMinMax (OpBuilder builder, Type inputDType, Attribute minAttr, Attribute maxAttr, IntegerAttr quantBits, int filterQuantDim, bool isSigned, BoolAttr narrowRange)
 Builds Tosa quantization attributes from min/max values.