MLIR  19.0.0git
Public Member Functions | List of all members
mlir::quant::UniformQuantizedPerAxisValueConverter Class Reference

An utility class to quantize an attribute by the per-axis quantization parameters. More...

#include "mlir/Dialect/Quant/UniformSupport.h"

Public Member Functions

 UniformQuantizedPerAxisValueConverter (UniformQuantizedPerAxisType uniformType)
 
ElementsAttr convert (Attribute realValue)
 Quantize an Attribute by the quantization parameters. More...
 

Detailed Description

An utility class to quantize an attribute by the per-axis quantization parameters.

The size of the quantization dim in the converted elements attribute should match the size of scales/zeroPoints vectors in the quantization parameters.

Definition at line 176 of file UniformSupport.h.

Constructor & Destructor Documentation

◆ UniformQuantizedPerAxisValueConverter()

mlir::quant::UniformQuantizedPerAxisValueConverter::UniformQuantizedPerAxisValueConverter ( UniformQuantizedPerAxisType  uniformType)
inlineexplicit

Definition at line 178 of file UniformSupport.h.

Member Function Documentation

◆ convert()

ElementsAttr UniformQuantizedPerAxisValueConverter::convert ( Attribute  realValue)

Quantize an Attribute by the quantization parameters.

Return nullptr if the conversion fails or the input array isn't an ElementsAttr.

Definition at line 52 of file UniformSupport.cpp.


The documentation for this class was generated from the following files: