TensorRT 10.0.0
nvinfer1::IInt8Calibrator Class Referenceabstract

Application-implemented interface for calibration. More...

#include <NvInfer.h>

Inheritance diagram for nvinfer1::IInt8Calibrator:
nvinfer1::IVersionedInterface nvinfer1::v_1_0::IInt8EntropyCalibrator nvinfer1::v_1_0::IInt8EntropyCalibrator2 nvinfer1::v_1_0::IInt8LegacyCalibrator nvinfer1::v_1_0::IInt8MinMaxCalibrator

Public Member Functions

virtual TRT_DEPRECATED int32_t getBatchSize () const noexcept=0
 Get the batch size used for calibration batches. More...
 
virtual bool getBatch (void *bindings[], char const *names[], int32_t nbBindings) noexcept=0
 Get a batch of input for calibration. More...
 
virtual void const * readCalibrationCache (std::size_t &length) noexcept=0
 Load a calibration cache. More...
 
virtual void writeCalibrationCache (void const *ptr, std::size_t length) noexcept=0
 Save a calibration cache. More...
 
virtual CalibrationAlgoType getAlgorithm () noexcept=0
 Get the algorithm used by this calibrator. More...
 
 ~IInt8Calibrator () noexcept override=default
 
- Public Member Functions inherited from nvinfer1::IVersionedInterface
virtual APILanguage getAPILanguage () const noexcept
 The language used to build the implementation of this Interface. More...
 
virtual InterfaceInfo getInterfaceInfo () const noexcept=0
 Return version information associated with this interface. Applications must not override this method. More...
 
virtual ~IVersionedInterface () noexcept=default
 

Additional Inherited Members

- Protected Member Functions inherited from nvinfer1::IVersionedInterface
 IVersionedInterface ()=default
 
 IVersionedInterface (IVersionedInterface const &)=default
 
 IVersionedInterface (IVersionedInterface &&)=default
 
IVersionedInterfaceoperator= (IVersionedInterface const &) &=default
 
IVersionedInterfaceoperator= (IVersionedInterface &&) &=default
 

Detailed Description

Application-implemented interface for calibration.

Calibration is a step performed by the builder when deciding suitable scale factors for 8-bit inference.

It must also provide a method for retrieving representative images which the calibration process can use to examine the distribution of activations. It may optionally implement a method for caching the calibration result for reuse on subsequent runs.

Constructor & Destructor Documentation

◆ ~IInt8Calibrator()

nvinfer1::IInt8Calibrator::~IInt8Calibrator ( )
overridedefaultnoexcept

Member Function Documentation

◆ getAlgorithm()

virtual CalibrationAlgoType nvinfer1::IInt8Calibrator::getAlgorithm ( )
pure virtualnoexcept

Get the algorithm used by this calibrator.

Returns
The algorithm used by the calibrator.

Implemented in nvinfer1::v_1_0::IInt8EntropyCalibrator, nvinfer1::v_1_0::IInt8EntropyCalibrator2, nvinfer1::v_1_0::IInt8MinMaxCalibrator, and nvinfer1::v_1_0::IInt8LegacyCalibrator.

◆ getBatch()

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

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()

◆ getBatchSize()

virtual TRT_DEPRECATED int32_t nvinfer1::IInt8Calibrator::getBatchSize ( ) const
pure virtualnoexcept

Get the batch size used for calibration batches.

Returns
The batch size.
Deprecated:
Deprecated in TensorRT 10.0. Implicit batch support is removed in TensorRT 10.0.

◆ readCalibrationCache()

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

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 ( void const *  ptr,
std::size_t  length 
)
pure virtualnoexcept

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: