LSQ

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

LSQ: https://arxiv.org/pdf/1902.08153.pdf 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