vector.table.quantize
← vector dialect
Map floating-point lanes to integer ordinal code lanes using an ordered rank-1 threshold table. For each input lane, the result code is the selected quantization bin; nan and tie attributes make NaN and threshold equality behavior explicit.
Operation contract
| Property |
Value |
| Semantic phase |
— |
| Traits |
Pure |
Signature
| Kind |
Name |
Type |
Cardinality |
Description |
| Operand |
input |
vector |
required |
Floating-point lanes to quantize. |
| Operand |
thresholds |
vector |
required |
Rank-1 ordered floating-point threshold table. |
| Result |
result |
vector |
required |
Unsigned ordinal code lanes stored in integer elements. |
| Attribute |
nan |
enum QuantizeNaN |
required |
Required NaN handling policy. |
| Attribute |
tie |
enum QuantizeTie |
required |
Required threshold equality policy. |
Verification constraints
HasFloatElement(input)
HasFloatElement(thresholds)
HasRankOneVector(thresholds)
HasIntegerElement(result)
SameElementType(input, thresholds)
SameShape(input, result)
Examples
%codes = vector.table.quantize %values, %thresholds {nan = zero, tie = lower} : vector<32xf32>, vector<15xf32> -> vector<32xi8>