Updates weights in an engine.
More...
Updates weights in an engine.
- Warning
- Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.
◆ ~IRefitter()
virtual nvinfer1::IRefitter::~IRefitter |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ setWeights()
virtual bool nvinfer1::IRefitter::setWeights |
( |
const char * |
layerName, |
|
|
WeightsRole |
role, |
|
|
Weights |
weights |
|
) |
| |
|
pure virtual |
Specify new weights for a layer of given name.
Returns true on success, or false if new weights are rejected. Possible reasons for rejection are:
- There is no such layer by that name.
- The layer does not have weights with the specified role.
- The number of weights is inconsistent with the layer’s original specification.
Modifying the weights before method refit() completes will result in undefined behavior.
◆ refitCudaEngine()
virtual bool nvinfer1::IRefitter::refitCudaEngine |
( |
| ) |
|
|
pure virtual |
Updates associated engine.
Return true if successful.
Failure occurs if getMissing() != 0 before the call.
◆ getMissing()
virtual int32_t nvinfer1::IRefitter::getMissing |
( |
int32_t |
size, |
|
|
const char ** |
layerNames, |
|
|
WeightsRole * |
roles |
|
) |
| |
|
pure virtual |
Get description of missing weights.
For example, if some Weights have been set, but the engine was optimized in a way that combines weights, any unsupplied Weights in the combination are considered missing.
- Parameters
-
size | The number of items that can be safely written to a non-null layerNames or roles. |
layerNames | Where to write the layer names. |
roles | Where to write the weights roles. |
- Returns
- The number of missing Weights.
If layerNames!=nullptr, each written pointer points to a string owned by the engine being refitted, and becomes invalid when the engine is destroyed.
◆ getAll()
virtual int32_t nvinfer1::IRefitter::getAll |
( |
int32_t |
size, |
|
|
const char ** |
layerNames, |
|
|
WeightsRole * |
roles |
|
) |
| |
|
pure virtual |
Get description of all weights that could be refit.
- Parameters
-
size | The number of items that can be safely written to a non-null layerNames or roles. |
layerNames | Where to write the layer names. |
roles | Where to write the weights roles. |
- Returns
- The number of Weights that could be refit.
If layerNames!=nullptr, each written pointer points to a string owned by the engine being refitted, and becomes invalid when the engine is destroyed.
◆ destroy()
virtual void nvinfer1::IRefitter::destroy |
( |
| ) |
|
|
pure virtual |
◆ setDynamicRange()
virtual bool nvinfer1::IRefitter::setDynamicRange |
( |
const char * |
tensorName, |
|
|
float |
min, |
|
|
float |
max |
|
) |
| |
|
pure virtual |
Update dynamic range for a tensor.
- Parameters
-
tensorName | The name of an ITensor in the network. |
min | The minimum of the dynamic range for the tensor. |
max | The maximum of the dynamic range for the tensor. |
- Returns
- True if successful; false otherwise.
Returns false if there is no Int8 engine tensor derived from a network tensor of that name. If successful, then getMissing may report that some weights need to be supplied.
◆ getDynamicRangeMin()
virtual float nvinfer1::IRefitter::getDynamicRangeMin |
( |
const char * |
tensorName | ) |
const |
|
pure virtual |
Get minimum of dynamic range.
- Returns
- Minimum of dynamic range.
If the dynamic range was never set, returns the minimum computed during calibration.
◆ getDynamicRangeMax()
virtual float nvinfer1::IRefitter::getDynamicRangeMax |
( |
const char * |
tensorName | ) |
const |
|
pure virtual |
Get maximum of dynamic range.
- Returns
- Maximum of dynamic range.
If the dynamic range was never set, returns the maximum computed during calibration.
◆ getTensorsWithDynamicRange()
virtual int32_t nvinfer1::IRefitter::getTensorsWithDynamicRange |
( |
int32_t |
size, |
|
|
const char ** |
tensorNames |
|
) |
| const |
|
pure virtual |
Get names of all tensors that have refittable dynamic ranges.
- Parameters
-
size | The number of items that can be safely written to a non-null tensorNames. |
tensorNames | Where to write the layer names. |
- Returns
- The number of Weights that could be refit.
If tensorNames!=nullptr, each written pointer points to a string owned by the engine being refitted, and becomes invalid when the engine is destroyed.
◆ setErrorRecorder()
virtual void nvinfer1::IRefitter::setErrorRecorder |
( |
IErrorRecorder * |
recorder | ) |
|
|
pure virtual |
Set the ErrorRecorder for this interface.
Assigns the ErrorRecorder to this interface. The ErrorRecorder will track all errors during execution. This function will call incRefCount of the registered ErrorRecorder at least once. Setting recorder to nullptr unregisters the recorder with the interface, resulting in a call to decRefCount if a recorder has been registered.
- Parameters
-
recorder | The error recorder to register with this interface. |
- See also
- getErrorRecorder
◆ getErrorRecorder()
virtual IErrorRecorder* nvinfer1::IRefitter::getErrorRecorder |
( |
| ) |
const |
|
pure virtual |
get the ErrorRecorder assigned to this interface.
Retrieves the assigned error recorder object for the given class. A default error recorder does not exist, so a nullptr will be returned if setErrorRecorder has not been called.
- Returns
- A pointer to the IErrorRecorder object that has been registered.
- See also
- setErrorRecorder
The documentation for this class was generated from the following file: