TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
nvinfer1::IInt8LegacyCalibrator Class Referenceabstract

Legacy calibrator left for backward compatibility with TensorRT 2.0. More...

Inheritance diagram for nvinfer1::IInt8LegacyCalibrator:
Collaboration diagram for nvinfer1::IInt8LegacyCalibrator:

Public Member Functions

CalibrationAlgoType getAlgorithm () override
 Signal that this is the legacy calibrator. More...
 
virtual double getQuantile () const =0
 The quantile (between 0 and 1) that will be used to select the region maximum when the quantile method is in use. More...
 
virtual double getRegressionCutoff () const =0
 The fraction (between 0 and 1) of the maximum used to define the regression cutoff when using regression to determine the region maximum. More...
 
virtual const void * readHistogramCache (std::size_t &length)=0
 Load a histogram. More...
 
virtual void writeHistogramCache (const void *ptr, std::size_t length)=0
 Save a histogram cache. More...
 
virtual ~IInt8LegacyCalibrator ()
 
virtual int32_t getBatchSize () const =0
 Get the batch size used for calibration batches. More...
 
virtual bool getBatch (void *bindings[], const char *names[], int32_t nbBindings)=0
 Get a batch of input for calibration. More...
 
virtual const void * readCalibrationCache (std::size_t &length)=0
 Load a calibration cache. More...
 
virtual void writeCalibrationCache (const void *ptr, std::size_t length)=0
 Save a calibration cache. More...
 

Detailed Description

Legacy calibrator left for backward compatibility with TensorRT 2.0.

This calibrator requires user parameterization, and is provided as a fallback option if the other calibrators yield poor results.

Constructor & Destructor Documentation

◆ ~IInt8LegacyCalibrator()

virtual nvinfer1::IInt8LegacyCalibrator::~IInt8LegacyCalibrator ( )
inlinevirtual

Member Function Documentation

◆ getAlgorithm()

CalibrationAlgoType nvinfer1::IInt8LegacyCalibrator::getAlgorithm ( )
inlineoverridevirtual

Signal that this is the legacy calibrator.

Implements nvinfer1::IInt8Calibrator.

◆ getQuantile()

virtual double nvinfer1::IInt8LegacyCalibrator::getQuantile ( ) const
pure virtual

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.

◆ getRegressionCutoff()

virtual double nvinfer1::IInt8LegacyCalibrator::getRegressionCutoff ( ) const
pure virtual

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

◆ readHistogramCache()

virtual const void* nvinfer1::IInt8LegacyCalibrator::readHistogramCache ( std::size_t &  length)
pure virtual

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.

Parameters
lengthThe length of the cached data, that should be set by the called function. If there is no data, this should be zero.
Returns
A pointer to the cache, or nullptr if there is no data.

◆ writeHistogramCache()

virtual void nvinfer1::IInt8LegacyCalibrator::writeHistogramCache ( const void *  ptr,
std::size_t  length 
)
pure virtual

Save a histogram cache.

Parameters
ptrA pointer to the data to cache.
lengthThe length in bytes of the data to cache.
See also
readHistogramCache()

◆ getBatchSize()

virtual int32_t nvinfer1::IInt8Calibrator::getBatchSize ( ) const
pure virtualinherited

Get the batch size used for calibration batches.

Returns
The batch size.

Implemented in sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator.

◆ getBatch()

virtual bool nvinfer1::IInt8Calibrator::getBatch ( void *  bindings[],
const char *  names[],
int32_t  nbBindings 
)
pure virtualinherited

Get a batch of input for calibration.

The batch size of the input must match the batch size returned by getBatchSize().

Parameters
bindingsAn array of pointers to device memory that must be updated to point to device memory containing each network input data.
namesThe names of the network input for each pointer in the binding array.
nbBindingsThe number of pointers in the bindings array.
Returns
False if there are no more batches for calibration.
See also
getBatchSize()

◆ readCalibrationCache()

virtual const void* nvinfer1::IInt8Calibrator::readCalibrationCache ( std::size_t &  length)
pure virtualinherited

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
lengthThe length of the cached data, that should be set by the called function. If there is no data, this should be zero.
Returns
A pointer to the cache, or nullptr if there is no data.

◆ writeCalibrationCache()

virtual void nvinfer1::IInt8Calibrator::writeCalibrationCache ( const void *  ptr,
std::size_t  length 
)
pure virtualinherited

Save a calibration cache.

Parameters
ptrA pointer to the data to cache.
lengthThe length in bytes of the data to cache.
See also
readCalibrationCache()

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