Plugin class for user-implemented layers. More...
Public Member Functions | |
virtual int32_t | getTensorRTVersion () const |
Return the API version with which this plugin was built. More... | |
virtual const char * | getPluginType () const =0 |
Return the plugin type. More... | |
virtual const char * | getPluginVersion () const =0 |
Return the plugin version. More... | |
virtual int32_t | getNbOutputs () const =0 |
Get the number of outputs from the layer. More... | |
virtual Dims | getOutputDimensions (int32_t index, const Dims *inputs, int32_t nbInputDims)=0 |
Get the dimension of an output tensor. More... | |
virtual bool | supportsFormat (DataType type, PluginFormat format) const =0 |
Check format support. More... | |
virtual void | configureWithFormat (const Dims *inputDims, int32_t nbInputs, const Dims *outputDims, int32_t nbOutputs, DataType type, PluginFormat format, int32_t maxBatchSize)=0 |
Configure the layer. More... | |
virtual int32_t | initialize ()=0 |
Initialize the layer for execution. More... | |
virtual void | terminate ()=0 |
Release resources acquired during plugin layer initialization. More... | |
virtual size_t | getWorkspaceSize (int32_t maxBatchSize) const =0 |
Find the workspace size required by the layer. More... | |
virtual int32_t | enqueue (int32_t batchSize, const void *const *inputs, void **outputs, void *workspace, cudaStream_t stream)=0 |
Execute the layer. More... | |
virtual size_t | getSerializationSize () const =0 |
Find the size of the serialization buffer required. More... | |
virtual void | serialize (void *buffer) const =0 |
Serialize the layer. More... | |
virtual void | destroy ()=0 |
Destroy the plugin object. More... | |
virtual IPluginV2 * | clone () const =0 |
Clone the plugin object. More... | |
virtual void | setPluginNamespace (const char *pluginNamespace)=0 |
Set the namespace that this plugin object belongs to. More... | |
virtual const char * | getPluginNamespace () const =0 |
Return the namespace of the plugin object. More... | |
Protected Member Functions | |
virtual | ~IPluginV2 () |
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.
|
inlineprotectedvirtual |
|
inlinevirtual |
Return the API version with which this plugin was built.
Do not override this method as it is used by the TensorRT library to maintain backwards-compatibility with plugins.
Reimplemented in nvinfer1::IPluginV2Ext, and nvinfer1::IPluginV2DynamicExt.
|
pure virtual |
Return the plugin type.
Should match the plugin name returned by the corresponding plugin creator
Implemented in UffPoolPluginV2, nvinfer1::plugin::SplitPlugin, nvinfer1::plugin::BatchedNMSDynamicPlugin, nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::ProposalPlugin, bert::EmbLayerNormVarSeqlenPlugin, nvinfer1::plugin::GroupNormalizationPlugin, nvinfer1::plugin::CropAndResizePlugin, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::InstanceNormalizationPlugin, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::BatchTilePlugin, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::ResizeNearest, nvinfer1::plugin::LReLU, bert::QKVToContextInterleavedPlugin, nvinfer1::plugin::Normalize, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, bert::SkipLayerNormInterleavedPlugin, nvinfer1::plugin::GridAnchorGenerator, and nvinfer1::plugin::BatchedNMSPlugin.
|
pure virtual |
Return the plugin version.
Should match the plugin version returned by the corresponding plugin creator
Implemented in UffPoolPluginV2, nvinfer1::plugin::SplitPlugin, nvinfer1::plugin::BatchedNMSDynamicPlugin, nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::ProposalPlugin, nvinfer1::plugin::GroupNormalizationPlugin, nvinfer1::plugin::CropAndResizePlugin, bert::EmbLayerNormVarSeqlenPlugin, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::InstanceNormalizationPlugin, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::BatchTilePlugin, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::ResizeNearest, nvinfer1::plugin::LReLU, nvinfer1::plugin::Normalize, bert::QKVToContextInterleavedPlugin, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, nvinfer1::plugin::GridAnchorGenerator, bert::SkipLayerNormInterleavedPlugin, and nvinfer1::plugin::BatchedNMSPlugin.
|
pure virtual |
Get the number of outputs from the layer.
This function is called by the implementations of INetworkDefinition and IBuilder. In particular, it is called prior to any call to initialize().
Implemented in UffPoolPluginV2, nvinfer1::plugin::SplitPlugin, nvinfer1::plugin::BatchedNMSDynamicPlugin, bert::EmbLayerNormVarSeqlenPlugin, bert::QKVToContextInterleavedPlugin, bert::SkipLayerNormInterleavedPlugin, nvinfer1::plugin::ProposalPlugin, nvinfer1::plugin::CropAndResizePlugin, nvinfer1::plugin::GroupNormalizationPlugin, nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::InstanceNormalizationPlugin, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::Normalize, nvinfer1::plugin::ResizeNearest, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::BatchedNMSPlugin, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::LReLU, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, nvinfer1::plugin::GridAnchorGenerator, and nvinfer1::plugin::BatchTilePlugin.
|
pure virtual |
Get the dimension of an output tensor.
index | The index of the output tensor. |
inputs | The input tensors. |
nbInputDims | The number of input tensors. |
This function is called by the implementations of INetworkDefinition and IBuilder. In particular, it is called prior to any call to initialize().
|
pure virtual |
Check format support.
type | DataType requested. |
format | PluginFormat requested. |
This function is called by the implementations of INetworkDefinition, IBuilder, and safe::ICudaEngine/ICudaEngine. In particular, it is called when creating an engine and when deserializing an engine.
Implemented in nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::ProposalPlugin, nvinfer1::plugin::CropAndResizePlugin, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::BatchTilePlugin, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::ResizeNearest, nvinfer1::plugin::LReLU, nvinfer1::plugin::Normalize, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, nvinfer1::plugin::GridAnchorGenerator, and nvinfer1::plugin::BatchedNMSPlugin.
|
pure virtual |
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.
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).
Implemented in nvinfer1::IPluginV2Ext.
|
pure virtual |
Initialize the layer for execution.
This is called when the engine is created.
Implemented in UffPoolPluginV2, nvinfer1::plugin::SplitPlugin, nvinfer1::plugin::BatchedNMSDynamicPlugin, bert::EmbLayerNormVarSeqlenPlugin, bert::QKVToContextInterleavedPlugin, bert::SkipLayerNormInterleavedPlugin, nvinfer1::plugin::ProposalPlugin, nvinfer1::plugin::GroupNormalizationPlugin, nvinfer1::plugin::CropAndResizePlugin, nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::InstanceNormalizationPlugin, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::BatchedNMSPlugin, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::Normalize, nvinfer1::plugin::ResizeNearest, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::LReLU, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, nvinfer1::plugin::GridAnchorGenerator, and nvinfer1::plugin::BatchTilePlugin.
|
pure virtual |
Release resources acquired during plugin layer initialization.
This is called when the engine is destroyed.
Implemented in UffPoolPluginV2, nvinfer1::plugin::SplitPlugin, nvinfer1::plugin::BatchedNMSDynamicPlugin, bert::EmbLayerNormVarSeqlenPlugin, bert::QKVToContextInterleavedPlugin, bert::SkipLayerNormInterleavedPlugin, nvinfer1::plugin::ProposalPlugin, nvinfer1::plugin::GroupNormalizationPlugin, nvinfer1::plugin::CropAndResizePlugin, nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::InstanceNormalizationPlugin, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::BatchedNMSPlugin, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::Normalize, nvinfer1::plugin::ResizeNearest, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::LReLU, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, nvinfer1::plugin::GridAnchorGenerator, and nvinfer1::plugin::BatchTilePlugin.
|
pure virtual |
Find the workspace size required by the layer.
This function is called during engine startup, after initialize(). The workspace size returned should be sufficient for any batch size up to the maximum.
|
pure virtual |
Execute the layer.
batchSize | The number of inputs in the batch. |
inputs | The memory for the input tensors. |
outputs | The memory for the output tensors. |
workspace | Workspace for execution. |
stream | The stream in which to execute the kernels. |
|
pure virtual |
Find the size of the serialization buffer required.
Implemented in UffPoolPluginV2, nvinfer1::plugin::BatchedNMSDynamicPlugin, bert::EmbLayerNormVarSeqlenPlugin, nvinfer1::plugin::ProposalPlugin, bert::QKVToContextInterleavedPlugin, nvinfer1::plugin::CropAndResizePlugin, nvinfer1::plugin::GroupNormalizationPlugin, bert::SkipLayerNormInterleavedPlugin, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::InstanceNormalizationPlugin, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::ResizeNearest, nvinfer1::plugin::SplitPlugin, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::Normalize, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::LReLU, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, nvinfer1::plugin::BatchTilePlugin, nvinfer1::plugin::GridAnchorGenerator, and nvinfer1::plugin::BatchedNMSPlugin.
|
pure virtual |
Serialize the layer.
buffer | A pointer to a buffer to serialize data. Size of buffer must be equal to value returned by getSerializationSize. |
Implemented in UffPoolPluginV2, nvinfer1::plugin::BatchedNMSDynamicPlugin, bert::EmbLayerNormVarSeqlenPlugin, nvinfer1::plugin::ProposalPlugin, bert::QKVToContextInterleavedPlugin, nvinfer1::plugin::CropAndResizePlugin, nvinfer1::plugin::GroupNormalizationPlugin, bert::SkipLayerNormInterleavedPlugin, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::InstanceNormalizationPlugin, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::SplitPlugin, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::ResizeNearest, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::Normalize, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::LReLU, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, nvinfer1::plugin::BatchTilePlugin, nvinfer1::plugin::GridAnchorGenerator, and nvinfer1::plugin::BatchedNMSPlugin.
|
pure virtual |
Destroy the plugin object.
This will be called when the network, builder or engine is destroyed.
Implemented in UffPoolPluginV2, nvinfer1::plugin::SplitPlugin, nvinfer1::plugin::BatchedNMSDynamicPlugin, nvinfer1::plugin::FlattenConcat, bert::EmbLayerNormVarSeqlenPlugin, nvinfer1::plugin::GroupNormalizationPlugin, nvinfer1::plugin::ProposalPlugin, nvinfer1::plugin::CropAndResizePlugin, nvinfer1::plugin::InstanceNormalizationPlugin, nvinfer1::plugin::BatchTilePlugin, nvinfer1::plugin::CoordConvACPlugin, bert::QKVToContextInterleavedPlugin, nvinfer1::plugin::LReLU, nvinfer1::plugin::Normalize, bert::SkipLayerNormInterleavedPlugin, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, nvinfer1::plugin::GridAnchorGenerator, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::BatchedNMSPlugin, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::ProposalLayer, and nvinfer1::plugin::ResizeNearest.
|
pure virtual |
Clone the plugin object.
This copies over internal plugin parameters and returns a new plugin object with these parameters.
Implemented in UffPoolPluginV2, nvinfer1::plugin::BatchedNMSDynamicPlugin, nvinfer1::plugin::SplitPlugin, nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::ProposalPlugin, nvinfer1::plugin::CropAndResizePlugin, nvinfer1::plugin::GroupNormalizationPlugin, nvinfer1::plugin::InstanceNormalizationPlugin, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::BatchTilePlugin, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::LReLU, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::Normalize, nvinfer1::plugin::ResizeNearest, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, nvinfer1::plugin::BatchedNMSPlugin, nvinfer1::plugin::GridAnchorGenerator, bert::EmbLayerNormVarSeqlenPlugin, bert::QKVToContextInterleavedPlugin, bert::SkipLayerNormInterleavedPlugin, nvinfer1::IPluginV2Ext, and nvinfer1::IPluginV2DynamicExt.
|
pure virtual |
Set the namespace that this plugin object belongs to.
Ideally, all plugin objects from the same plugin library should have the same namespace.
Implemented in nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::GroupNormalizationPlugin, nvinfer1::plugin::ProposalPlugin, bert::EmbLayerNormVarSeqlenPlugin, nvinfer1::plugin::CropAndResizePlugin, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::InstanceNormalizationPlugin, bert::QKVToContextInterleavedPlugin, nvinfer1::plugin::Normalize, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, bert::SkipLayerNormInterleavedPlugin, nvinfer1::plugin::GridAnchorGenerator, UffPoolPluginV2, nvinfer1::plugin::BatchedNMSDynamicPlugin, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::BatchTilePlugin, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::ResizeNearest, nvinfer1::plugin::BatchedNMSPlugin, nvinfer1::plugin::BasePlugin, and nvinfer1::plugin::SplitPlugin.
|
pure virtual |
Return the namespace of the plugin object.
Implemented in UffPoolPluginV2, nvinfer1::plugin::SplitPlugin, nvinfer1::plugin::BatchedNMSDynamicPlugin, nvinfer1::plugin::FlattenConcat, nvinfer1::plugin::GroupNormalizationPlugin, nvinfer1::plugin::ProposalPlugin, nvinfer1::plugin::CropAndResizePlugin, bert::EmbLayerNormVarSeqlenPlugin, nvinfer1::plugin::CoordConvACPlugin, nvinfer1::plugin::InstanceNormalizationPlugin, nvinfer1::plugin::SpecialSlice, nvinfer1::plugin::BatchTilePlugin, nvinfer1::plugin::ProposalLayer, nvinfer1::plugin::GenerateDetection, nvinfer1::plugin::MultilevelCropAndResize, nvinfer1::plugin::PyramidROIAlign, nvinfer1::plugin::DetectionLayer, nvinfer1::plugin::MultilevelProposeROI, nvinfer1::plugin::Normalize, nvinfer1::plugin::ResizeNearest, bert::QKVToContextInterleavedPlugin, nvinfer1::plugin::DetectionOutput, nvinfer1::plugin::RPROIPlugin, nvinfer1::plugin::PriorBox, nvinfer1::plugin::Region, nvinfer1::plugin::Reorg, nvinfer1::plugin::GridAnchorGenerator, bert::SkipLayerNormInterleavedPlugin, nvinfer1::plugin::BatchedNMSPlugin, and nvinfer1::plugin::BasePlugin.