TorchLean API

NN.Spec.Quantization.Rational

Executable Rational Tensor Quantization #

FloatLib supplies the scalar nearest-even affine quantizer and its range, round-trip, and error proofs. This adapter maps those same operations over shape-indexed rational tensors.

Apply the affine quantizer independently at every coordinate of an arbitrary-rank tensor.

Instances For

    Reconstruct every code in an arbitrary-rank tensor on the quantizer's rational grid.

    Instances For

      Pointwise condition saying that quantization does not clip any coordinate of x.

      Instances For

        Pointwise condition saying that every stored code belongs to the quantizer's code set.

        Instances For

          Every coordinate produced by tensor quantization lies in the declared code interval.

          An in-range code tensor survives pointwise dequantization and requantization exactly.

          If no coordinate clips, every tensor reconstruction error is at most half a step.