TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
pytorch_quantization.calib.max.MaxCalibrator Class Reference
Inheritance diagram for pytorch_quantization.calib.max.MaxCalibrator:
Collaboration diagram for pytorch_quantization.calib.max.MaxCalibrator:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

def pytorch_quantization.calib.max.MaxCalibrator.__init__ (   self,
  num_bits,
  axis,
  unsigned,
  track_amax = False 
)

Member Function Documentation

◆ amaxs()

def pytorch_quantization.calib.max.MaxCalibrator.amaxs (   self)

◆ collect()

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.

◆ reset()

def pytorch_quantization.calib.max.MaxCalibrator.reset (   self)
Reset the collected absolute max

Reimplemented from pytorch_quantization.calib.calibrator._Calibrator.

◆ compute_amax() [1/2]

def pytorch_quantization.calib.max.MaxCalibrator.compute_amax (   self)
Return the absolute max of all tensors collected

◆ __str__()

def pytorch_quantization.calib.max.MaxCalibrator.__str__ (   self)

◆ __repr__()

def pytorch_quantization.calib.max.MaxCalibrator.__repr__ (   self)

◆ compute_amax() [2/2]

def pytorch_quantization.calib.calibrator._Calibrator.compute_amax (   self,
args,
**  kwargs 
)
inherited
Abstract method: compute the amax from the collected data

Returns:
    amax: a tensor

Member Data Documentation

◆ _track_amax

pytorch_quantization.calib.max.MaxCalibrator._track_amax
private

◆ _amaxs

pytorch_quantization.calib.max.MaxCalibrator._amaxs
private

◆ _calib_amax

pytorch_quantization.calib.max.MaxCalibrator._calib_amax
private

◆ _num_bits

pytorch_quantization.calib.calibrator._Calibrator._num_bits
privateinherited

◆ _axis

pytorch_quantization.calib.calibrator._Calibrator._axis
privateinherited

◆ _unsigned

pytorch_quantization.calib.calibrator._Calibrator._unsigned
privateinherited

The documentation for this class was generated from the following file: