Public Member Functions | |
def | __init__ (self, num_bits, axis, unsigned, track_amax=False) |
def | amaxs (self) |
def | collect (self, x) |
def | reset (self) |
def | compute_amax (self) |
def | __str__ (self) |
def | __repr__ (self) |
def | compute_amax (self, *args, **kwargs) |
Private Attributes | |
_track_amax | |
_amaxs | |
_calib_amax | |
_num_bits | |
_axis | |
_unsigned | |
Max calibrator, tracks the maximum value globally Args: calib_desc: A MaxCalibDescriptor. num_bits: An integer. Number of bits of quantization. axis: A tuple. see QuantDescriptor. unsigned: A boolean. using unsigned quantization. Readonly Properties: amaxs: A list of amax. Numpy array is saved as it is likely to be used for some plot.
def pytorch_quantization.calib.max.MaxCalibrator.__init__ | ( | self, | |
num_bits, | |||
axis, | |||
unsigned, | |||
track_amax = False |
|||
) |
def pytorch_quantization.calib.max.MaxCalibrator.amaxs | ( | self | ) |
def pytorch_quantization.calib.max.MaxCalibrator.collect | ( | self, | |
x | |||
) |
Tracks the absolute max of all tensors Args: x: A tensor Raises: RuntimeError: If amax shape changes
Reimplemented from pytorch_quantization.calib.calibrator._Calibrator.
def pytorch_quantization.calib.max.MaxCalibrator.reset | ( | self | ) |
Reset the collected absolute max
Reimplemented from pytorch_quantization.calib.calibrator._Calibrator.
def pytorch_quantization.calib.max.MaxCalibrator.compute_amax | ( | self | ) |
Return the absolute max of all tensors collected
def pytorch_quantization.calib.max.MaxCalibrator.__str__ | ( | self | ) |
def pytorch_quantization.calib.max.MaxCalibrator.__repr__ | ( | self | ) |
Reimplemented from pytorch_quantization.calib.calibrator._Calibrator.
|
inherited |
Abstract method: compute the amax from the collected data Returns: amax: a tensor
|
private |
|
private |
|
private |
|
privateinherited |
|
privateinherited |
|
privateinherited |