MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / LSQParams

Class LSQParams

imperative/python/megengine/quantization/utils.py:107–121  ·  view source on GitHub ↗

r"""LSQ qparams with extra grad_scale slot.

Source from the content-addressed store, hash-verified

105
106
107class LSQParams(QParams):
108 r"""LSQ qparams with extra grad_scale slot."""
109
110 __slots__ = "mode", "dtype_meta", "scale", "zero_point", "grad_scale"
111
112 def __init__(
113 self,
114 mode: QuantMode,
115 dtype_meta: QuantDtypeMeta,
116 scale: Tensor,
117 zero_point: Tensor,
118 grad_scale: Tensor,
119 ):
120 super().__init__(mode, dtype_meta, scale, zero_point)
121 self.grad_scale = grad_scale
122
123
124class QParamsModuleMixin(abc.ABC):

Callers 1

get_qparamsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected