IInt8LegacyCalibrator

class tensorrt.IInt8LegacyCalibrator(self: tensorrt.tensorrt.IInt8LegacyCalibrator) → None

Extends the IInt8Calibrator class.

Variables:
  • quantilefloat The quantile (between 0 and 1) that will be used to select the region maximum when the quantile method is in use. See the user guide for more details on how the quantile is used.
  • regression_cutofffloat The fraction (between 0 and 1) of the maximum used to define the regression cutoff when using regression to determine the region maximum. See the user guide for more details on how the regression cutoff is used
get_algorithm(self: tensorrt.tensorrt.IInt8LegacyCalibrator) → tensorrt.tensorrt.CalibrationAlgoType
get_batch(self: tensorrt.tensorrt.IInt8LegacyCalibrator, bindings: List[capsule], names: List[str]) → object

Get a batch of input for calibration. The batch size of the input must match the batch size returned by batch_size() .

Parameters:
  • bindings – An array of device memory objects that must be set to the memory containing each network input data.
  • names – The names of the network inputs for each object in the bindings array.
Returns:

False if there are no more batches for calibration.

get_batch_size(self: tensorrt.tensorrt.IInt8LegacyCalibrator) → int
get_quantile(self: tensorrt.tensorrt.IInt8LegacyCalibrator) → float
get_regression_cutoff(self: tensorrt.tensorrt.IInt8LegacyCalibrator) → float
read_calibration_cache(self: tensorrt.tensorrt.IInt8LegacyCalibrator, length: int) → capsule

Load a calibration cache.

Calibration is potentially expensive, so it can be useful to generate the calibration data once, then use it on subsequent builds of the network. The cache includes the regression cutoff and quantile values used to generate it, and will not be used if these do not batch the settings of the current calibrator. However, the network should also be recalibrated if its structure changes, or the input data set changes, and it is the responsibility of the application to ensure this.

Parameters:length – The length of the cached data, that should be set by the called function. If there is no data, this should be zero.
Returns:A cache object or None if there is no data.
read_histogram_cache(self: tensorrt.tensorrt.IInt8LegacyCalibrator, arg0: int) → capsule

Load a histogram. Histogram generation is potentially expensive, so it can be useful to generate the histograms once, then use them when exploring the space of calibrations. The histograms should be regenerated if the network structure changes, or the input data set changes, and it is the responsibility of the application to ensure this. See the user guide for more details on how the regression cutoff is used

Parameters:length – The length of the cached data, that should be set by the called function. If there is no data, this should be zero.
Returns:The cache or None if there is no cache.
write_calibration_cache(self: tensorrt.tensorrt.IInt8LegacyCalibrator, data: capsule, length: int) → None

Save a calibration cache.

Parameters:
  • data – The data to cache.
  • length – The length in bytes of the data to cache.
write_histogram_cache(self: tensorrt.tensorrt.IInt8LegacyCalibrator, arg0: capsule, arg1: int) → None

Save a histogram cache.

Parameters:
  • data – The data to cache.
  • length – The length in bytes of the data to cache.