class LSQ(dtype, enable=True, eps=1e-05, **kwargs)[源代码]

LSQ: Estimating and scaling the task loss gradient at each weight and activation layer’s quantizer step size

  • dtype (Union[str, QuantDtypeMeta]) – a string or QuantDtypeMeta indicating the target quantization dtype of input.

  • enable (bool) – whether do normal_forward or fake_quant_forward.

  • eps (float) – a small value to avoid division by zero. Default: 1e-5