|
virtual int32_t | getTensorRTVersion () const noexcept |
| Return the API version with which this plugin was built. More...
|
|
virtual AsciiChar const * | getPluginType () const noexcept=0 |
| Return the plugin type. Should match the plugin name returned by the corresponding plugin creator. More...
|
|
virtual AsciiChar const * | getPluginVersion () const noexcept=0 |
| Return the plugin version. Should match the plugin version returned by the corresponding plugin creator. More...
|
|
virtual int32_t | getNbOutputs () const noexcept=0 |
| Get the number of outputs from the layer. More...
|
|
virtual Dims | getOutputDimensions (int32_t index, Dims const *inputs, int32_t nbInputDims) noexcept=0 |
| Get the dimension of an output tensor. More...
|
|
virtual bool | supportsFormat (DataType type, PluginFormat format) const noexcept=0 |
| Check format support. More...
|
|
virtual void | configureWithFormat (Dims const *inputDims, int32_t nbInputs, Dims const *outputDims, int32_t nbOutputs, DataType type, PluginFormat format, int32_t maxBatchSize) noexcept=0 |
| Configure the layer. More...
|
|
virtual int32_t | initialize () noexcept=0 |
| Initialize the layer for execution. This is called when the engine is created. More...
|
|
virtual void | terminate () noexcept=0 |
| Release resources acquired during plugin layer initialization. This is called when the engine is destroyed. More...
|
|
virtual size_t | getWorkspaceSize (int32_t maxBatchSize) const noexcept=0 |
| Find the workspace size required by the layer. More...
|
|
virtual int32_t | enqueue (int32_t batchSize, void const *const *inputs, void *const *outputs, void *workspace, cudaStream_t stream) noexcept=0 |
| Execute the layer. More...
|
|
virtual size_t | getSerializationSize () const noexcept=0 |
| Find the size of the serialization buffer required. More...
|
|
virtual void | serialize (void *buffer) const noexcept=0 |
| Serialize the layer. More...
|
|
virtual void | destroy () noexcept=0 |
| Destroy the plugin object. This will be called when the network, builder or engine is destroyed.
|
|
virtual IPluginV2 * | clone () const noexcept=0 |
| Clone the plugin object. This copies over internal plugin parameters and returns a new plugin object with these parameters. More...
|
|
virtual void | setPluginNamespace (AsciiChar const *pluginNamespace) noexcept=0 |
| Set the namespace that this plugin object belongs to. Ideally, all plugin objects from the same plugin library should have the same namespace. More...
|
|
virtual AsciiChar const * | getPluginNamespace () const noexcept=0 |
| Return the namespace of the plugin object.
|
|
Plugin class for user-implemented layers.
Plugins are a mechanism for applications to implement custom layers. When combined with IPluginCreator it provides a mechanism to register plugins and look up the Plugin Registry during de-serialization.
- See also
- IPluginCreator
-
IPluginRegistry
virtual IPluginV2* nvinfer1::IPluginV2::clone |
( |
| ) |
const |
|
pure virtualnoexcept |
Clone the plugin object. This copies over internal plugin parameters and returns a new plugin object with these parameters.
The TensorRT runtime calls clone() to clone the plugin when an execution context is created for an engine, after the engine has been created. The runtime does not call initialize() on the cloned plugin, so the cloned plugin should be created in an initialized state.
Implemented in nvinfer1::IPluginV2Ext, and nvinfer1::IPluginV2DynamicExt.
virtual void nvinfer1::IPluginV2::configureWithFormat |
( |
Dims const * |
inputDims, |
|
|
int32_t |
nbInputs, |
|
|
Dims const * |
outputDims, |
|
|
int32_t |
nbOutputs, |
|
|
DataType |
type, |
|
|
PluginFormat |
format, |
|
|
int32_t |
maxBatchSize |
|
) |
| |
|
pure virtualnoexcept |
Configure the layer.
This function is called by the builder prior to initialize(). It provides an opportunity for the layer to make algorithm choices on the basis of its weights, dimensions, and maximum batch size.
- Parameters
-
inputDims | The input tensor dimensions. |
nbInputs | The number of inputs. |
outputDims | The output tensor dimensions. |
nbOutputs | The number of outputs. |
type | The data type selected for the engine. |
format | The format selected for the engine. |
maxBatchSize | The maximum batch size. |
The dimensions passed here do not include the outermost batch size (i.e. for 2-D image networks, they will be 3-dimensional CHW dimensions).
- Warning
- for the format field, the values PluginFormat::kCHW4, PluginFormat::kCHW16, and PluginFormat::kCHW32 will not be passed in, this is to keep backward compatibility with TensorRT 5.x series. Use PluginV2IOExt or PluginV2DynamicExt for other PluginFormats.
-
DataType:kBOOL not supported.
Implemented in nvinfer1::IPluginV2Ext.