My Project
Public Member Functions | List of all members
mlir::quantizer::UniformConstraintsBuilder Class Reference

#include <UniformConstraints.h>

Public Member Functions

 UniformConstraintsBuilder (CAGSlice &slice)
 
void coupleAnchors (CAGAnchorNode *a, CAGAnchorNode *b)
 
void applyStats (CAGAnchorNode *a, TensorAxisStatistics stats)
 
void clamp (CAGAnchorNode *a, APFloat minValue, APFloat maxValue)
 
void propagateExplicitScale (CAGAnchorNode *from, CAGAnchorNode *to)
 

Detailed Description

Factory methods for adding CAG constraints of various kinds suitable for solving for uniform quantization.

Constructor & Destructor Documentation

◆ UniformConstraintsBuilder()

mlir::quantizer::UniformConstraintsBuilder::UniformConstraintsBuilder ( CAGSlice slice)
inline

Member Function Documentation

◆ applyStats()

void UniformConstraintsBuilder::applyStats ( CAGAnchorNode a,
TensorAxisStatistics  stats 
)

Applies statistics constraints to the given anchor, such that the solver ensures that the statistics are representable by chosen types.

◆ clamp()

void UniformConstraintsBuilder::clamp ( CAGAnchorNode a,
APFloat  minValue,
APFloat  maxValue 
)

Applies a constraint to a node which allows solutions that do not extend beyond given min/max bounds (this is a hint that the tensor will not take values outside of these bounds). If either minValue or maxValue is NAN, then that side is considered open.

◆ coupleAnchors()

void UniformConstraintsBuilder::coupleAnchors ( CAGAnchorNode a,
CAGAnchorNode b 
)

Adds a coupling constraint between two nodes, effectively treating them as a hard identity relationship.

◆ propagateExplicitScale()

void UniformConstraintsBuilder::propagateExplicitScale ( CAGAnchorNode from,
CAGAnchorNode to 
)

Propagates an explicit scale from an anchor that may have a uniform |selectedType| to the |explicitScaleZeroPoint| field of the to node. This is typically used with a to node that has a candidate quantized type of |UniformExplicitFixedPointScale|, indicating that it can be an arbitrary (signed) type that is expected to share the same scale as the originating node.


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