Skip to main content

Module per_block_affine

Module per_block_affine 

Source
Expand description

Per-block affine quantization descriptor (scheme tag 0x03).

The tensor is divided into fixed-size contiguous blocks along a specified axis. Each block carries its own scale (and optionally zero_point). Partial trailing blocks are permitted; see docs/spec/quantization/per-block-affine.md § Padding for the normative padding rules.

See docs/spec/quantization/per-block-affine.md for the normative definition.

Structs§

PerBlockAffine
Quantization parameters for per-block affine quantization.

Constants§

FLAG_SYMMETRIC
Bit 0: symmetric flag — zero-point array is implicit (all zeros).
PER_BLOCK_AFFINE_MIN_BLOCK_SIZE
Minimum block size for per-block affine (must be a power of two ≥ 2).
RESERVED_MASK
All bits except bit 0 are reserved and must be zero.