A data-free post-training quantization method includes obtaining data distribution input by a user, where the data distribution is distribution to which an input activation value of each network layer of a floating-point model conforms; inputting random data into the floating-point model to obtain the input activation value of each network layer; performing statistical analysis on the input activation value of each network layer based on the data distribution, to obtain a data range of the input activation value of each network layer; determining a quantization parameter of the input activation value of each network layer based on endpoint values of the data range; and during inference by using the floating-point model, performing, by using the quantization parameter of the input activation value of each network layer, quantization processing on the input activation value generated during inference of each network layer.
Full Text
What is claimed is: