|
| RndInt8Calibrator (int batches, std::vector< int > &elemCount, const std::string &cacheFile, const nvinfer1::INetworkDefinition &network, std::ostream &err) |
|
| ~RndInt8Calibrator () |
|
bool | getBatch (void *bindings[], const char *names[], int nbBindings) override |
|
int | getBatchSize () const override |
| Get the batch size used for calibration batches. More...
|
|
const void * | readCalibrationCache (size_t &length) override |
|
virtual void | writeCalibrationCache (const void *, size_t) override |
|
CalibrationAlgoType | getAlgorithm () override |
| Signal that this is the entropy calibrator 2. 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...
|
|
◆ RndInt8Calibrator()
sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::RndInt8Calibrator |
( |
int |
batches, |
|
|
std::vector< int > & |
elemCount, |
|
|
const std::string & |
cacheFile, |
|
|
const nvinfer1::INetworkDefinition & |
network, |
|
|
std::ostream & |
err |
|
) |
| |
◆ ~RndInt8Calibrator()
sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::~RndInt8Calibrator |
( |
| ) |
|
|
inline |
◆ getBatch() [1/2]
bool sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::getBatch |
( |
void * |
bindings[], |
|
|
const char * |
names[], |
|
|
int |
nbBindings |
|
) |
| |
|
override |
◆ getBatchSize()
int sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::getBatchSize |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ readCalibrationCache() [1/2]
const void * sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::readCalibrationCache |
( |
size_t & |
length | ) |
|
|
override |
◆ writeCalibrationCache() [1/2]
virtual void sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::writeCalibrationCache |
( |
const void * |
, |
|
|
size_t |
|
|
) |
| |
|
inlineoverridevirtual |
◆ getAlgorithm()
CalibrationAlgoType nvinfer1::IInt8EntropyCalibrator2::getAlgorithm |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ getBatch() [2/2]
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
-
bindings | An array of pointers to device memory that must be updated to point to device memory containing each network input data. |
names | The names of the network input for each pointer in the binding array. |
nbBindings | The number of pointers in the bindings array. |
- Returns
- False if there are no more batches for calibration.
- See also
- getBatchSize()
◆ readCalibrationCache() [2/2]
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
-
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 pointer to the cache, or nullptr if there is no data.
◆ writeCalibrationCache() [2/2]
virtual void nvinfer1::IInt8Calibrator::writeCalibrationCache |
( |
const void * |
ptr, |
|
|
std::size_t |
length |
|
) |
| |
|
pure virtualinherited |
Save a calibration cache.
- Parameters
-
ptr | A pointer to the data to cache. |
length | The length in bytes of the data to cache. |
- See also
- readCalibrationCache()
◆ mBatches
int sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::mBatches {} |
|
private |
◆ mCurrentBatch
int sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::mCurrentBatch {} |
|
private |
◆ mCacheFile
std::string sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::mCacheFile |
|
private |
◆ mInputDeviceBuffers
std::map<std::string, void*> sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::mInputDeviceBuffers |
|
private |
◆ mCalibrationCache
std::vector<char> sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::mCalibrationCache |
|
private |
◆ mErr
std::ostream& sample::anonymous_namespace{sampleEngines.cpp}::RndInt8Calibrator::mErr |
|
private |
The documentation for this class was generated from the following file: