IPluginExt

class tensorrt.IPluginExt

Plugin class for user-implemented layers.

Plugins are a mechanism for applications to implement custom layers. Each plugin is owned by the application, and its lifetime must span any use of it by TensorRT.

Variables:
  • tensorrt_versionint The API version with which this plugin was built.
  • plugin_typestr The plugin type. Should match the plugin name returned by the corresponding plugin creator
  • plugin_versionstr The plugin version. Should match the plugin version returned by the corresponding plugin creator.
clone(self: tensorrt.tensorrt.IPluginExt) → tensorrt.tensorrt.IPluginExt
configure_with_format(self: tensorrt.tensorrt.IPluginExt, input_shapes: List[tensorrt.tensorrt.Dims], output_shapes: List[tensorrt.tensorrt.Dims], dtype: tensorrt.tensorrt.DataType, format: tensorrt.tensorrt.PluginFormat, max_batch_size: int) → None

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.

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

Parameters:
  • input_shapes – The shapes of the input tensors.
  • output_shapes – The shapes of the output tensors.
  • dtype – The data type selected for the engine.
  • format – The format selected for the engine.
  • max_batch_size – The maximum batch size.
destroy(self: tensorrt.tensorrt.IPluginExt) → None
supports_format(self: tensorrt.tensorrt.IPluginExt, dtype: tensorrt.tensorrt.DataType, format: tensorrt.tensorrt.PluginFormat) → bool

Check format support.

This function is called by the implementations of INetworkDefinition , Builder , and ICudaEngine . In particular, it is called when creating an engine and when deserializing an engine.

Parameters:
  • dtype – Data type requested.
  • format – PluginFormat requested.
Returns:

True if the plugin supports the type-format combination.