TensorRT OSS 8.0 release

Signed-off-by: Rajeev Rao <rajeevrao@nvidia.com>
This commit is contained in:
Rajeev Rao
2021-07-02 00:21:09 -07:00
committed by Rajeev Rao
parent d04182cd00
commit aff45dd565
556 changed files with 34713 additions and 23987 deletions
@@ -19,122 +19,123 @@
namespace tensorrt
{
namespace IAlgorithmIOInfoDOC
{
constexpr const char* descr = R"trtdoc(
This class carries information about input or output of the algorithm.
IAlgorithmIOInfo for all the input and output along with IAlgorithmVariant denotes the variation of algorithm
and can be used to select or reproduce an algorithm using IAlgorithmSelector::selectAlgorithms().
namespace IAlgorithmIOInfoDOC
{
constexpr const char* descr = R"trtdoc(
This class carries information about input or output of the algorithm.
IAlgorithmIOInfo for all the input and output along with IAlgorithmVariant denotes the variation of algorithm
and can be used to select or reproduce an algorithm using IAlgorithmSelector.select_algorithms().
:ivar tensor_format: :class:`TensorFormat` TensorFormat of the input/output of algorithm.
:ivar dtype: :class:`DataType` DataType of the input/output of algorithm.
:ivar strides: :class:`Dims` strides of the input/output tensor of algorithm.
)trtdoc";
} /* IAlgorithmIOInfoDOC */
:ivar tensor_format: :class:`TensorFormat` TensorFormat of the input/output of algorithm.
:ivar dtype: :class:`DataType` DataType of the input/output of algorithm.
:ivar strides: :class:`Dims` strides of the input/output tensor of algorithm.
)trtdoc";
} // namespace IAlgorithmIOInfoDOC
namespace IAlgorithmVariantDOC
{
constexpr const char* descr = R"trtdoc(
provides a unique 128-bit identifier, which along with the input and output information
denotes the variation of algorithm and can be used to select or reproduce an algorithm,
using IAlgorithmSelector::selectAlgorithms()
see IAlgorithmIOInfo, IAlgorithm, IAlgorithmSelector::selectAlgorithms()
note A single implementation can have multiple tactics.
namespace IAlgorithmVariantDOC
{
constexpr const char* descr = R"trtdoc(
provides a unique 128-bit identifier, which along with the input and output information
denotes the variation of algorithm and can be used to select or reproduce an algorithm,
using IAlgorithmSelector.select_algorithms()
see IAlgorithmIOInfo, IAlgorithm, IAlgorithmSelector.select_algorithms()
note A single implementation can have multiple tactics.
:ivar implementation: :class:`int` implementation of the algorithm.
:ivar tactic: :class:`int` tactic of the algorithm.
)trtdoc";
:ivar implementation: :class:`int` implementation of the algorithm.
:ivar tactic: :class:`int` tactic of the algorithm.
)trtdoc";
} /* IAlgorithmVariantDOC*/
} // namespace IAlgorithmVariantDOC
namespace IAlgorithmContextDoc
{
constexpr const char* descr = R"trtdoc(
Describes the context and requirements, that could be fulfilled by one or
more instances of IAlgorithm.
see IAlgorithm
namespace IAlgorithmContextDoc
{
constexpr const char* descr = R"trtdoc(
Describes the context and requirements, that could be fulfilled by one or
more instances of IAlgorithm.
see IAlgorithm
:ivar name: :class:`str` name of the algorithm node.
:ivar num_inputs: :class:`int` number of inputs of the algorithm.
:ivar num_outputs: :class:`int` number of outputs of the algorithm.
)trtdoc";
:ivar name: :class:`str` name of the algorithm node.
:ivar num_inputs: :class:`int` number of inputs of the algorithm.
:ivar num_outputs: :class:`int` number of outputs of the algorithm.
)trtdoc";
constexpr const char* get_shape = R"trtdoc(
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
choices --> (min, max, opt)
constexpr const char* get_shape = R"trtdoc(
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
choices --> (min, max, opt)
:arg index: Index of the input or output of the algorithm. Incremental numbers assigned to indices of inputs and the outputs.
:arg index: Index of the input or output of the algorithm. Incremental numbers assigned to indices of inputs and the outputs.
:returns: A `List[Dims]` of length 3, containing the minimum, optimum, and maximum shapes, in that order. If the shapes have not been set yet, an empty list is returned.`
)trtdoc";
} /* IAlgorithmContextDoc*/
:returns: A `List[Dims]` of length 3, containing the minimum, optimum, and maximum shapes, in that order. If the shapes have not been set yet, an empty list is returned.`
)trtdoc";
} // namespace IAlgorithmContextDoc
namespace IAlgorithmDoc
{
constexpr const char* descr = R"trtdoc(
Application-implemented interface for selecting and reporting the tactic selection of a layer.
Tactic Selection is a step performed by the builder for deciding best algorithms for a layer.
namespace IAlgorithmDoc
{
constexpr const char* descr = R"trtdoc(
Application-implemented interface for selecting and reporting the tactic selection of a layer.
Tactic Selection is a step performed by the builder for deciding best algorithms for a layer.
:ivar algorithm_variant: :class:`IAlgorithmVariant&` the algorithm variant.
:ivar timing_msec: :class:`float` The time in milliseconds to execute the algorithm.
:ivar workspace_size: :class:`int` The size of the GPU temporary memory in bytes which the algorithm uses at execution time.
)trtdoc";
:ivar algorithm_variant: :class:`IAlgorithmVariant&` the algorithm variant.
:ivar timing_msec: :class:`float` The time in milliseconds to execute the algorithm.
:ivar workspace_size: :class:`int` The size of the GPU temporary memory in bytes which the algorithm uses at execution time.
)trtdoc";
constexpr const char* get_algorithm_io_info = R"trtdoc(
A single call for both inputs and outputs. Incremental numbers assigned to indices of inputs and the outputs.
constexpr const char* get_algorithm_io_info = R"trtdoc(
A single call for both inputs and outputs. Incremental numbers assigned to indices of inputs and the outputs.
:arg index: Index of the input or output of the algorithm. Incremental numbers assigned to indices of inputs and the outputs.
:arg index: Index of the input or output of the algorithm. Incremental numbers assigned to indices of inputs and the outputs.
:returns: A :class:`IAlgorithmIOInfo&`
)trtdoc";
} /* IAlgorithmDoc */
:returns: A :class:`IAlgorithmIOInfo&`
)trtdoc";
} // namespace IAlgorithmDoc
namespace IAlgorithmSelectorDoc
{
constexpr const char* descr = R"trtdoc(
Interface implemented by application for selecting and reporting algorithms of a layer provided by the
builder.
note A layer in context of algorithm selection may be different from ILayer in INetworkDefiniton.
For example, an algorithm might be implementing a conglomeration of multiple ILayers in INetworkDefinition.
)trtdoc";
namespace IAlgorithmSelectorDoc
{
constexpr const char* descr = R"trtdoc(
Interface implemented by application for selecting and reporting algorithms of a layer provided by the
builder.
note A layer in context of algorithm selection may be different from ILayer in INetworkDefiniton.
For example, an algorithm might be implementing a conglomeration of multiple ILayers in INetworkDefinition.
)trtdoc";
constexpr const char* select_algorithms = R"trtdoc(
Select Algorithms for a layer from the given list of algorithm choices.
return The number of choices selected from [0, len(choices)-1].
note TRT uses its default algorithm selection to choose from the list provided.
If return value is 0, TRTs default algorithm selection is used unless strict type constraints are set.
The list of choices is valid only for this specific algorithm context.
constexpr const char* select_algorithms = R"trtdoc(
Select Algorithms for a layer from the given list of algorithm choices.
A possible implementation may look like this:
::
def select_algorithms(self, context, choices):
assert len(choices) > 0
selection = [i for i in range(len(choices))]
return (len(choices), selection)
Note: TRT uses its default algorithm selection to choose from the list returned by the user.
If the returned list is empty, TRTs default algorithm selection is used unless strict type constraints are set.
The list of choices is valid only for this specific algorithm context.
:arg context: The context for which the algorithm choices are valid.
:arg choices: The list of algorithm choices to select for implementation of this layer.
:arg selection: The user writes indices of selected choices in to selection buffer which is of size number of choices.
A possible implementation may look like this:
::
:returns: A :class:`Tuple(int, List[int])` this first values in the size of the array the second one is a sublist of tactic indices from selection.
def select_algorithms(self, context, choices):
assert len(choices) > 0
return list(range(len(choices)))
)trtdoc";
constexpr const char* report_algorithm = R"trtdoc(
Called by TensorRT to report choices it made.
note For a given optimization profile, this call comes after all calls to selectAlgorithms.
choices[i] is the choice that TensorRT made for algoContexts[i], for i in [0, num_algorithms-1]
:arg context: The context for which the algorithm choices are valid.
:arg choices: The list of algorithm choices to select for implementation of this layer.
A possible implementation may look like this:
::
def report_algorithms(self, contexts, choices):
# Prints the time of the chosen algorithm by TRT from the
# selection list passed in by select_algorithms
print(algoChoices[0].timing_msec)
:arg contexts: The list of all algorithm contexts.
:arg choices: The list of algorithm choices made by TensorRT.
)trtdoc";
} /* IAlgorithmSelectorDoc */
}
:returns: A :class:`List[int]` indicating the indices from the choices vector that TensorRT should choose from.
)trtdoc";
constexpr const char* report_algorithms = R"trtdoc(
Called by TensorRT to report choices it made.
Note: For a given optimization profile, this call comes after all calls to select_algorithms.
choices[i] is the choice that TensorRT made for algoContexts[i], for i in [0, num_algorithms-1]
A possible implementation may look like this:
::
def report_algorithms(self, contexts, choices):
# Prints the time of the chosen algorithm by TRT from the
# selection list passed in by select_algorithms
for choice in choices:
print(choice.timing_msec)
:arg contexts: The list of all algorithm contexts.
:arg choices: The list of algorithm choices made by TensorRT corresponding to each context.
)trtdoc";
} // namespace IAlgorithmSelectorDoc
} // namespace tensorrt
File diff suppressed because it is too large Load Diff
+121 -125
View File
@@ -19,161 +19,157 @@
namespace tensorrt
{
namespace DataTypeDoc
{
constexpr const char* descr = R"trtdoc(
Represents data types.
namespace DataTypeDoc
{
constexpr const char* descr = R"trtdoc(
Represents data types.
:itemsize: :class:`int` The size in bytes of this :class:`DataType` .
)trtdoc";
:itemsize: :class:`int` The size in bytes of this :class:`DataType` .
)trtdoc";
constexpr const char* float32 = R"trtdoc(Represents a 32-bit floating point number.)trtdoc";
constexpr const char* float16 = R"trtdoc(Represents a 16-bit floating point number.)trtdoc";
constexpr const char* int8 = R"trtdoc(Represents an 8-bit integer.)trtdoc";
constexpr const char* int32 = R"trtdoc(Represents a 32-bit integer.)trtdoc";
constexpr const char* boolean = R"trtdoc(Represents a boolean.)trtdoc";
constexpr const char* float32 = R"trtdoc(Represents a 32-bit floating point number.)trtdoc";
constexpr const char* float16 = R"trtdoc(Represents a 16-bit floating point number.)trtdoc";
constexpr const char* int8 = R"trtdoc(Represents an 8-bit integer.)trtdoc";
constexpr const char* int32 = R"trtdoc(Represents a 32-bit integer.)trtdoc";
constexpr const char* boolean = R"trtdoc(Represents a boolean.)trtdoc";
} /* DataTypeDoc */
} // namespace DataTypeDoc
namespace DimensionTypeDoc
{
constexpr const char* descr = R"trtdoc(The type of data encoded across this dimension.)trtdoc";
constexpr const char* SPATIAL = R"trtdoc(Elements correspond to different spatial data.)trtdoc";
constexpr const char* CHANNEL = R"trtdoc(Elements correspond to different channels.)trtdoc";
constexpr const char* INDEX = R"trtdoc(Elements correspond to different batch index.)trtdoc";
constexpr const char* SEQUENCE = R"trtdoc(Elements correspond to different sequence values.)trtdoc";
namespace WeightsRoleDoc
{
constexpr const char* descr
= R"trtdoc(How a layer uses particular Weights. The power weights of an IScaleLayer are omitted. Refitting those is not supported.)trtdoc";
constexpr const char* KERNEL
= R"trtdoc(Kernel for :class:`IConvolutionLayer` , :class:`IDeconvolutionLayer` , or :class:`IFullyConnectedLayer` .)trtdoc";
constexpr const char* BIAS
= R"trtdoc(Bias for :class:`IConvolutionLayer` , :class:`IDeconvolutionLayer` , or :class:`IFullyConnectedLayer` .)trtdoc";
constexpr const char* SHIFT = R"trtdoc(Shift part of :class:`IScaleLayer` .)trtdoc";
constexpr const char* SCALE = R"trtdoc(Scale part of :class:`IScaleLayer` .)trtdoc";
constexpr const char* CONSTANT = R"trtdoc(Weights for :class:`IConstantLayer` .)trtdoc";
constexpr const char* ANY = R"trtdoc(Any other weights role.)trtdoc";
} /* DimensionTypeDoc */
} // namespace WeightsRoleDoc
namespace WeightsRoleDoc
{
constexpr const char* descr = R"trtdoc(How a layer uses particular Weights. The power weights of an IScaleLayer are omitted. Refitting those is not supported.)trtdoc";
constexpr const char* KERNEL = R"trtdoc(Kernel for :class:`IConvolutionLayer` , :class:`IDeconvolutionLayer` , or :class:`IFullyConnectedLayer` .)trtdoc";
constexpr const char* BIAS = R"trtdoc(Bias for :class:`IConvolutionLayer` , :class:`IDeconvolutionLayer` , or :class:`IFullyConnectedLayer` .)trtdoc";
constexpr const char* SHIFT = R"trtdoc(Shift part of :class:`IScaleLayer` .)trtdoc";
constexpr const char* SCALE = R"trtdoc(Scale part of :class:`IScaleLayer` .)trtdoc";
constexpr const char* CONSTANT = R"trtdoc(Weights for :class:`IConstantLayer` .)trtdoc";
namespace WeightsDoc
{
constexpr const char* descr = R"trtdoc(
An array of weights used as a layer parameter.
The weights are held by reference until the engine has been built - deep copies are not made automatically.
} /* WeightsRoleDoc */
:ivar dtype: :class:`DataType` The type of the weights.
:ivar size: :class:`int` The number of weights in the array.
:ivar nbytes: :class:`int` Total bytes consumed by the elements of the weights buffer.
)trtdoc";
namespace WeightsDoc
{
constexpr const char* descr = R"trtdoc(
An array of weights used as a layer parameter.
The weights are held by reference until the engine has been built - deep copies are not made automatically.
// FIXME: Weird bug occurring here. Cannot provide :arg:
constexpr const char* init_type = R"trtdoc(
Initializes an empty (0-length) Weights object with the specified type.
:ivar dtype: :class:`DataType` The type of the weights.
:ivar size: :class:`int` The number of weights in the array.
:ivar nbytes: :class:`int` Total bytes consumed by the elements of the weights buffer.
)trtdoc";
:type: A type to initialize the weights with. Default: :class:`tensorrt.float32`
)trtdoc";
constexpr const char* init_type = R"trtdoc(
Initializes an empty (0-length) Weights object with the specified type.
// FIXME: Weird bug occurring here. Cannot provide :arg:
constexpr const char* init_numpy = R"trtdoc(
:a: A numpy array whose values to use. No deep copies are made.
)trtdoc";
:type: A type to initialize the weights with. Default: :class:`tensorrt.float32`
)trtdoc";
constexpr const char* numpy = R"trtdoc(
Create a numpy array using the underlying buffer of this weights object.
constexpr const char* init_numpy = R"trtdoc(
:a: A numpy array whose values to use. No deep copies are made.
)trtdoc";
:returns: A new numpy array that holds a reference to this weight object's buffer - no deep copy is made.
)trtdoc";
} // namespace WeightsDoc
constexpr const char* numpy = R"trtdoc(
Create a numpy array using the underlying buffer of this weights object.
namespace DimsDoc
{
constexpr const char* descr = R"trtdoc(
Structure to define the dimensions of a tensor. :class:`Dims` and all derived classes behave like Python :class:`tuple` s. Furthermore, the TensorRT API can implicitly convert Python iterables to :class:`Dims` objects, so :class:`tuple` or :class:`list` can be used in place of this class.
)trtdoc";
:returns: A new numpy array that holds a reference to this weight object's buffer - no deep copy is made.
)trtdoc";
} /* WeightsDoc */
constexpr const char* volume = R"trtdoc(
Computes the total volume of the dimensions
namespace DimsDoc
{
constexpr const char* descr = R"trtdoc(
Structure to define the dimensions of a tensor. :class:`Dims` and all derived classes behave like Python :class:`tuple` s. Furthermore, the TensorRT API can implicitly convert Python iterables to :class:`Dims` objects, so :class:`tuple` or :class:`list` can be used in place of this class.
)trtdoc";
:returns: Total volume. `0` for empty dimensions.
)trtdoc";
constexpr const char* volume = R"trtdoc(
Computes the total volume of the dimensions
constexpr const char* get_type = R"trtdoc(
Queries the type of a dimension.
:returns: Total volume. `0` for empty dimensions.
)trtdoc";
:returns: The type of the specified dimension.
)trtdoc";
constexpr const char* get_type = R"trtdoc(
Queries the type of a dimension.
constexpr const char* MAX_DIMS = R"trtdoc(
The maximum number of dimensions supported by :class:`Dims`.
)trtdoc";
:returns: The type of the specified dimension.
)trtdoc";
} // namespace DimsDoc
constexpr const char* MAX_DIMS = R"trtdoc(
The maximum number of dimensions supported by :class:`Dims`.
)trtdoc";
namespace Dims2Doc
{
constexpr const char* descr = R"trtdoc(
Structure to define 2D shape.
)trtdoc";
} // namespace Dims2Doc
} /* DimsDoc */
namespace DimsHWDoc
{
constexpr const char* descr = R"trtdoc(
Structure to define 2D shape with height and width.
namespace Dims2Doc
{
constexpr const char* descr = R"trtdoc(
Structure to define 2D shape.
)trtdoc";
} /* DimsDoc */
:ivar h: :class:`int` The first dimension (height).
:ivar w: :class:`int` The second dimension (width).
)trtdoc";
} // namespace DimsHWDoc
namespace DimsHWDoc
{
constexpr const char* descr = R"trtdoc(
Structure to define 2D shape with height and width.
namespace Dims3Doc
{
constexpr const char* descr = R"trtdoc(
Structure to define 3D shape.
)trtdoc";
} // namespace Dims3Doc
:ivar h: :class:`int` The first dimension (height).
:ivar w: :class:`int` The second dimension (width).
)trtdoc";
} /* DimsDoc */
namespace DimsCHWDoc
{
constexpr const char* descr = R"trtdoc(
Structure to define 3D tensor with a channel dimension, height, and width.
namespace Dims3Doc
{
constexpr const char* descr = R"trtdoc(
Structure to define 3D shape.
)trtdoc";
} /* DimsDoc */
:ivar c: :class:`int` The first dimension (channel).
:ivar h: :class:`int` The second dimension (height).
:ivar w: :class:`int` The third dimension (width).
)trtdoc";
} // namespace DimsCHWDoc
namespace DimsCHWDoc
{
constexpr const char* descr = R"trtdoc(
Structure to define 3D tensor with a channel dimension, height, and width.
namespace Dims4Doc
{
constexpr const char* descr = R"trtdoc(
Structure to define 4D tensor.
)trtdoc";
} // namespace Dims4Doc
:ivar c: :class:`int` The first dimension (channel).
:ivar h: :class:`int` The second dimension (height).
:ivar w: :class:`int` The third dimension (width).
)trtdoc";
} /* DimsDoc */
namespace DimsNCHWDoc
{
constexpr const char* descr = R"trtdoc(
Structure to define 4D tensor with a batch dimension, a channel dimension, height and width.
namespace Dims4Doc
{
constexpr const char* descr = R"trtdoc(
Structure to define 4D tensor.
)trtdoc";
} /* DimsDoc */
:ivar n: :class:`int` The first dimension (batch).
:ivar c: :class:`int` The second dimension (channel).
:ivar h: :class:`int` The third dimension (height).
:ivar w: :class:`int` The fourth dimension (width).
)trtdoc";
} // namespace DimsNCHWDoc
namespace DimsNCHWDoc
{
constexpr const char* descr = R"trtdoc(
Structure to define 4D tensor with a batch dimension, a channel dimension, height and width.
namespace IHostMemoryDoc
{
constexpr const char* descr = R"trtdoc(
Handles library allocated memory that is accessible to the user.
:ivar n: :class:`int` The first dimension (batch).
:ivar c: :class:`int` The second dimension (channel).
:ivar h: :class:`int` The third dimension (height).
:ivar w: :class:`int` The fourth dimension (width).
)trtdoc";
} /* DimsDoc */
The memory allocated via the host memory object is owned by the library and will be de-allocated when object is destroyed.
namespace IHostMemoryDoc
{
constexpr const char* descr = R"trtdoc(
Handles library allocated memory that is accessible to the user.
This class exposes a buffer interface using Python's buffer protocol.
The memory allocated via the host memory object is owned by the library and will be de-allocated when object is destroyed.
:ivar dtype: :class:`DataType` The data type of this buffer.
:ivar nbytes: :class:`int` Total bytes consumed by the elements of the buffer.
)trtdoc";
} // namespace IHostMemoryDoc
This class exposes a buffer interface using Python's buffer protocol.
:ivar dtype: :class:`DataType` The data type of this buffer.
:ivar nbytes: :class:`int` Total bytes consumed by the elements of the buffer.
)trtdoc";
} /* IHostMemoryDoc */
} /* tensorrt */
} // namespace tensorrt
File diff suppressed because it is too large Load Diff
+128 -127
View File
@@ -14,176 +14,177 @@
* limitations under the License.
*/
// This file contains all int8 calibration related docstrings, since these are typically too long to keep in the binding code.
// This file contains all int8 calibration related docstrings, since these are typically too long to keep in the binding
// code.
#pragma once
namespace tensorrt
{
namespace CalibrationAlgoTypeDoc
{
constexpr const char* descr = R"trtdoc(
Version of calibration algorithm to use.
)trtdoc";
} /* CalibrationAlgoTypeDoc */
namespace CalibrationAlgoTypeDoc
{
constexpr const char* descr = R"trtdoc(
Version of calibration algorithm to use.
)trtdoc";
} // namespace CalibrationAlgoTypeDoc
namespace IInt8CalibratorDoc
{
constexpr const char* descr = R"trtdoc(
Application-implemented interface for calibration. Calibration is a step performed by the builder when deciding suitable scale factors for 8-bit inference. It must also provide a method for retrieving representative images which the calibration process can use to examine the distribution of activations. It may optionally implement a method for caching the calibration result for reuse on subsequent runs.
namespace IInt8CalibratorDoc
{
constexpr const char* descr = R"trtdoc(
Application-implemented interface for calibration. Calibration is a step performed by the builder when deciding suitable scale factors for 8-bit inference. It must also provide a method for retrieving representative images which the calibration process can use to examine the distribution of activations. It may optionally implement a method for caching the calibration result for reuse on subsequent runs.
:ivar batch_size: :class:`int` The batch size used for calibration batches.
:ivar algorithm: :class:`CalibrationAlgoType` The algorithm used by this calibrator.
)trtdoc";
:ivar batch_size: :class:`int` The batch size used for calibration batches.
:ivar algorithm: :class:`CalibrationAlgoType` The algorithm used by this calibrator.
)trtdoc";
constexpr const char* get_batch_size = R"trtdoc(
Get the batch size used for calibration batches.
constexpr const char* get_batch_size = R"trtdoc(
Get the batch size used for calibration batches.
:returns: The batch size.
)trtdoc";
:returns: The batch size.
)trtdoc";
constexpr const char* get_algorithm = R"trtdoc(
Get the algorithm used by this calibrator.
constexpr const char* get_algorithm = R"trtdoc(
Get the algorithm used by this calibrator.
:returns: The algorithm used by this calibrator.
)trtdoc";
:returns: The algorithm used by this calibrator.
)trtdoc";
constexpr const char* get_batch = R"trtdoc(
Get a batch of input for calibration. The batch size of the input must match the batch size returned by :func:`get_batch_size` .
constexpr const char* get_batch = R"trtdoc(
Get a batch of input for calibration. The batch size of the input must match the batch size returned by :func:`get_batch_size` .
A possible implementation may look like this:
::
A possible implementation may look like this:
::
def get_batch(names):
try:
# Assume self.batches is a generator that provides batch data.
data = next(self.batches)
# Assume that self.device_input is a device buffer allocated by the constructor.
cuda.memcpy_htod(self.device_input, data)
return [int(self.device_input)]
except StopIteration:
# When we're out of batches, we return either [] or None.
# This signals to TensorRT that there is no calibration data remaining.
return None
def get_batch(names):
try:
# Assume self.batches is a generator that provides batch data.
data = next(self.batches)
# Assume that self.device_input is a device buffer allocated by the constructor.
cuda.memcpy_htod(self.device_input, data)
return [int(self.device_input)]
except StopIteration:
# When we're out of batches, we return either [] or None.
# This signals to TensorRT that there is no calibration data remaining.
return None
:arg names: The names of the network inputs for each object in the bindings array.
:arg names: The names of the network inputs for each object in the bindings array.
:returns: A :class:`list` of device memory pointers set to the memory containing each network input data, or an empty :class:`list` if there are no more batches for calibration. You can allocate these device buffers with pycuda, for example, and then cast them to :class:`int` to retrieve the pointer.
)trtdoc";
:returns: A :class:`list` of device memory pointers set to the memory containing each network input data, or an empty :class:`list` if there are no more batches for calibration. You can allocate these device buffers with pycuda, for example, and then cast them to :class:`int` to retrieve the pointer.
)trtdoc";
constexpr const char* read_calibration_cache = R"trtdoc(
Load a calibration cache.
constexpr const char* read_calibration_cache = R"trtdoc(
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 match 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.
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 match 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.
Reading a cache is just like reading any other file in Python. For example, one possible implementation is:
::
Reading a cache is just like reading any other file in Python. For example, one possible implementation is:
::
def read_calibration_cache(self):
# If there is a cache, use it instead of calibrating again. Otherwise, implicitly return None.
if os.path.exists(self.cache_file):
with open(self.cache_file, "rb") as f:
return f.read()
def read_calibration_cache(self):
# If there is a cache, use it instead of calibrating again. Otherwise, implicitly return None.
if os.path.exists(self.cache_file):
with open(self.cache_file, "rb") as f:
return f.read()
:returns: A cache object or None if there is no data.
)trtdoc";
:returns: A cache object or None if there is no data.
)trtdoc";
constexpr const char* write_calibration_cache = R"trtdoc(
Save a calibration cache.
constexpr const char* write_calibration_cache = R"trtdoc(
Save a calibration cache.
Writing a cache is just like writing any other buffer in Python. For example, one possible implementation is:
::
Writing a cache is just like writing any other buffer in Python. For example, one possible implementation is:
::
def write_calibration_cache(self, cache):
with open(self.cache_file, "wb") as f:
f.write(cache)
def write_calibration_cache(self, cache):
with open(self.cache_file, "wb") as f:
f.write(cache)
:arg cache: The calibration cache to write.
)trtdoc";
:arg cache: The calibration cache to write.
)trtdoc";
} /* IInt8CalibratorDoc */
} // namespace IInt8CalibratorDoc
namespace IInt8LegacyCalibratorDoc
{
constexpr const char* descr = R"trtdoc(
Extends the :class:`IInt8Calibrator` class.
This calibrator requires user parameterization, and is provided as a fallback option if the other calibrators yield poor results.
:ivar quantile: :class:`float` The quantile (between 0 and 1) that will be used to select the region maximum when the quantile method is in use. See the user guide for more details on how the quantile is used.
:ivar regression_cutoff: :class:`float` The fraction (between 0 and 1) of the maximum used to define the regression cutoff when using regression to determine the region maximum. See the user guide for more details on how the regression cutoff is used
)trtdoc";
namespace IInt8LegacyCalibratorDoc
{
constexpr const char* descr = R"trtdoc(
Extends the :class:`IInt8Calibrator` class.
This calibrator requires user parameterization, and is provided as a fallback option if the other calibrators yield poor results.
constexpr const char* readHistogramCache = R"trtdoc(
Load a histogram.
Histogram generation is potentially expensive, so it can be useful to generate the histograms once, then use them when exploring
the space of calibrations. The histograms should be regenerated if the network structure
changes, or the input data set changes, and it is the responsibility of the application to ensure this.
See the user guide for more details on how the regression cutoff is used
:ivar quantile: :class:`float` The quantile (between 0 and 1) that will be used to select the region maximum when the quantile method is in use. See the user guide for more details on how the quantile is used.
:ivar regression_cutoff: :class:`float` The fraction (between 0 and 1) of the maximum used to define the regression cutoff when using regression to determine the region maximum. See the user guide for more details on how the regression cutoff is used
)trtdoc";
:arg length: The length of the cached data, that should be set by the called function. If there is no data, this should be zero.
constexpr const char* readHistogramCache = R"trtdoc(
Load a histogram.
Histogram generation is potentially expensive, so it can be useful to generate the histograms once, then use them when exploring
the space of calibrations. The histograms should be regenerated if the network structure
changes, or the input data set changes, and it is the responsibility of the application to ensure this.
See the user guide for more details on how the regression cutoff is used
:returns: The cache or None if there is no cache.
)trtdoc";
:arg length: The length of the cached data, that should be set by the called function. If there is no data, this should be zero.
constexpr const char* writeHistogramCache = R"trtdoc(
Save a histogram cache.
:returns: The cache or None if there is no cache.
)trtdoc";
:arg data: The data to cache.
:arg length: The length in bytes of the data to cache.
)trtdoc";
constexpr const char* writeHistogramCache = R"trtdoc(
Save a histogram cache.
constexpr const char* get_algorithm = R"trtdoc(
Signals that this is the legacy calibrator.
:arg data: The data to cache.
:arg length: The length in bytes of the data to cache.
)trtdoc";
:returns: :class:`CalibrationAlgoType.LEGACY_CALIBRATION`
)trtdoc";
} /* IInt8LegacyCalibratorDoc */
constexpr const char* get_algorithm = R"trtdoc(
Signals that this is the legacy calibrator.
namespace IInt8EntropyCalibratorDoc
{
constexpr const char* descr = R"trtdoc(
Extends the :class:`IInt8Calibrator` class.
:returns: :class:`CalibrationAlgoType.LEGACY_CALIBRATION`
)trtdoc";
} // namespace IInt8LegacyCalibratorDoc
This is the Legacy Entropy calibrator. It is less complicated than the legacy calibrator and produces better results.
)trtdoc";
namespace IInt8EntropyCalibratorDoc
{
constexpr const char* descr = R"trtdoc(
Extends the :class:`IInt8Calibrator` class.
constexpr const char* get_algorithm = R"trtdoc(
Signals that this is the entropy calibrator.
This is the Legacy Entropy calibrator. It is less complicated than the legacy calibrator and produces better results.
)trtdoc";
:returns: :class:`CalibrationAlgoType.ENTROPY_CALIBRATION`
)trtdoc";
} /* IInt8EntropyCalibratorDoc */
constexpr const char* get_algorithm = R"trtdoc(
Signals that this is the entropy calibrator.
namespace IInt8EntropyCalibrator2Doc
{
constexpr const char* descr = R"trtdoc(
Extends the :class:`IInt8Calibrator` class.
:returns: :class:`CalibrationAlgoType.ENTROPY_CALIBRATION`
)trtdoc";
} // namespace IInt8EntropyCalibratorDoc
This is the preferred calibrator. This is the required calibrator for DLA, as it supports per activation tensor scaling.
)trtdoc";
namespace IInt8EntropyCalibrator2Doc
{
constexpr const char* descr = R"trtdoc(
Extends the :class:`IInt8Calibrator` class.
constexpr const char* get_algorithm = R"trtdoc(
Signals that this is the entropy calibrator 2.
This is the preferred calibrator. This is the required calibrator for DLA, as it supports per activation tensor scaling.
)trtdoc";
:returns: :class:`CalibrationAlgoType.ENTROPY_CALIBRATION_2`
)trtdoc";
} /* IInt8EntropyCalibrator2Doc */
constexpr const char* get_algorithm = R"trtdoc(
Signals that this is the entropy calibrator 2.
namespace IInt8MinMaxCalibratorDoc
{
constexpr const char* descr = R"trtdoc(
Extends the :class:`IInt8Calibrator` class.
:returns: :class:`CalibrationAlgoType.ENTROPY_CALIBRATION_2`
)trtdoc";
} // namespace IInt8EntropyCalibrator2Doc
This is the preferred calibrator for NLP tasks for all backends. It supports per activation tensor scaling.
)trtdoc";
namespace IInt8MinMaxCalibratorDoc
{
constexpr const char* descr = R"trtdoc(
Extends the :class:`IInt8Calibrator` class.
constexpr const char* get_algorithm = R"trtdoc(
Signals that this is the minmax calibrator.
This is the preferred calibrator for NLP tasks for all backends. It supports per activation tensor scaling.
)trtdoc";
:returns: :class:`CalibrationAlgoType.MINMAX_CALIBRATION`
)trtdoc";
} /* IInt8MinMaxCalibratorDoc */
constexpr const char* get_algorithm = R"trtdoc(
Signals that this is the minmax calibrator.
} /* tensorrt */
:returns: :class:`CalibrationAlgoType.MINMAX_CALIBRATION`
)trtdoc";
} // namespace IInt8MinMaxCalibratorDoc
} // namespace tensorrt
+221 -338
View File
@@ -18,401 +18,284 @@
namespace tensorrt
{
namespace IPluginDoc
{
constexpr const char* descr = R"trtdoc(
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.
namespace IPluginV2Doc
{
constexpr const char* descr = R"trtdoc(
Plugin class for user-implemented layers.
:ivar num_outputs: :class:`int` The number of outputs from the layer. This is used by the implementations of :class:`INetworkDefinition` and :class:`Builder` . In particular, it is called prior to any call to :func:`initialize` .
:ivar serialization_size: :class:`int` The size of the serialization buffer required.
)trtdoc";
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.
constexpr const char* get_output_shape = R"trtdoc(
Get the dimension of an output tensor.
:arg index: The index of the output tensor.
:arg input_shapes: The shapes of the input tensors.
:ivar num_outputs: :class:`int` The number of outputs from the layer. This is used by the implementations of :class:`INetworkDefinition` and :class:`Builder` . In particular, it is called prior to any call to :func:`initialize` .
:ivar tensorrt_version: :class:`int` The API version with which this plugin was built.
:ivar plugin_type: :class:`str` The plugin type. Should match the plugin name returned by the corresponding plugin creator
:ivar plugin_version: :class:`str` The plugin version. Should match the plugin version returned by the corresponding plugin creator.
:ivar plugin_namespace: :class:`str` The namespace that this plugin object belongs to. Ideally, all plugin objects from the same plugin library should have the same namespace.
:ivar serialization_size: :class:`int` The size of the serialization buffer required.
)trtdoc";
This function is called by the implementations of :class:`INetworkDefinition` and :class:`Builder` . In particular, it is called prior to any call to :func:`initialize` .
)trtdoc";
constexpr const char* get_output_shape = R"trtdoc(
Get the dimension of an output tensor.
constexpr const char* configure = R"trtdoc(
Configure the layer.
:arg index: The index of the output tensor.
:arg input_shapes: The shapes of the input tensors.
This function is called by the :class:`Builder` prior to :func:`initialize` . It provides an opportunity for the layer to make algorithm choices on the basis of its weights, dimensions, and maximum batch size. The type is assumed to be FP32 and format NCHW.
This function is called by the implementations of :class:`INetworkDefinition` and :class:`Builder` . In particular, it is called prior to any call to :func:`initialize` .
)trtdoc";
:arg input_shapes: The shapes of the input tensors.
:arg output_shapes: The shapes of the output tensors.
:arg max_batch_size: The maximum batch size.
constexpr const char* supports_format = R"trtdoc(
Check format support.
The shapes passed here do not include the outermost batch size (i.e. for 2D image networks, they will be 3D CHW dimensions).
This function is called by the implementations of :class:`INetworkDefinition` , :class:`Builder` , and :class:`ICudaEngine` . In particular, it is called when creating an engine and when deserializing an engine.
This method is not called for :class:`IPluginExt` classes; :func:`configure_with_format` is called instead.
)trtdoc";
:arg dtype: Data type requested.
:arg format: TensorFormat requested.
constexpr const char* initialize = R"trtdoc(
Initialize the layer for execution. This is called when the engine is created.
:returns: True if the plugin supports the type-format combination.
)trtdoc";
:returns: 0 for success, else non-zero (which will cause engine termination).
)trtdoc";
constexpr const char* configure_with_format = R"trtdoc(
Configure the layer.
constexpr const char* terminate = R"trtdoc(
Release resources acquired during plugin layer initialization. This is called when the engine is destroyed.
)trtdoc";
This function is called by the :class:`Builder` prior to :func:`initialize` . It provides an opportunity for the layer to make algorithm choices on the basis of its weights, dimensions, and maximum batch size.
constexpr const char* get_workspace_size = R"trtdoc(
Find the workspace size required by the layer.
The dimensions passed here do not include the outermost batch size (i.e. for 2D image networks, they will be 3D CHW dimensions).
This function is called during engine startup, after :func:`initialize` . The workspace size returned should be sufficient for any batch size up to the maximum.
:arg input_shapes: The shapes of the input tensors.
:arg output_shapes: The shapes of the output tensors.
:arg dtype: The data type selected for the engine.
:arg format: The format selected for the engine.
:arg max_batch_size: The maximum batch size.
)trtdoc";
:arg max_batch_size: :class:`int` The maximum possible batch size during inference.
constexpr const char* initialize = R"trtdoc(
Initialize the layer for execution. This is called when the engine is created.
:returns: The workspace size.
)trtdoc";
:returns: 0 for success, else non-zero (which will cause engine termination).
)trtdoc";
constexpr const char* execute_async = R"trtdoc(
Execute the layer asynchronously.
constexpr const char* terminate = R"trtdoc(
Release resources acquired during plugin layer initialization. This is called when the engine is destroyed.
)trtdoc";
:arg batch_size: The number of inputs in the batch.
:arg inputs: The memory for the input tensors.
:arg outputs: The memory for the output tensors.
:arg workspace: Workspace for execution.
:arg stream_handle: The stream in which to execute the kernels.
constexpr const char* get_workspace_size = R"trtdoc(
Find the workspace size required by the layer.
:returns: 0 for success, else non-zero (which will cause engine termination).
)trtdoc";
This function is called during engine startup, after :func:`initialize` . The workspace size returned should be sufficient for any batch size up to the maximum.
constexpr const char* serialize = R"trtdoc(
Serialize the layer.
:arg max_batch_size: :class:`int` The maximum possible batch size during inference.
:arg buffer: A buffer of size at least :attr:`serialization_size` .
)trtdoc";
:returns: The workspace size.
)trtdoc";
} /* IPluginDoc */
constexpr const char* execute_async = R"trtdoc(
Execute the layer asynchronously.
namespace IPluginExtDoc
{
constexpr const char* descr = R"trtdoc(
Plugin class for user-implemented layers.
:arg batch_size: The number of inputs in the batch.
:arg inputs: The memory for the input tensors.
:arg outputs: The memory for the output tensors.
:arg workspace: Workspace for execution.
:arg stream_handle: The stream in which to execute the kernels.
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.
:returns: 0 for success, else non-zero (which will cause engine termination).
)trtdoc";
:ivar tensorrt_version: :class:`int` The API version with which this plugin was built.
)trtdoc";
constexpr const char* serialize = R"trtdoc(
Serialize the plugin.
)trtdoc";
constexpr const char* supports_format = R"trtdoc(
Check format support.
constexpr const char* destroy = R"trtdoc(
Destroy the plugin object. This will be called when the :class:`INetworkDefinition` , :class:`Builder` or :class:`ICudaEngine` is destroyed.
)trtdoc";
This function is called by the implementations of :class:`INetworkDefinition` , :class:`Builder` , and :class:`ICudaEngine` . In particular, it is called when creating an engine and when deserializing an engine.
constexpr const char* clone = R"trtdoc(
Clone the plugin object. This copies over internal plugin parameters and returns a new plugin object with these parameters.
)trtdoc";
} // namespace IPluginV2Doc
:arg dtype: Data type requested.
:arg format: TensorFormat requested.
namespace IPluginV2ExtDoc
{
constexpr const char* descr = R"trtdoc(
Plugin class for user-implemented layers.
:returns: True if the plugin supports the type-format combination.
)trtdoc";
Plugins are a mechanism for applications to implement custom layers. This interface provides additional capabilities to the IPluginV2 interface by supporting different output data types.
constexpr const char* configure_with_format = R"trtdoc(
Configure the layer.
:ivar tensorrt_version: :class:`int` The API version with which this plugin was built.
)trtdoc";
This function is called by the :class:`Builder` prior to :func:`initialize` . It provides an opportunity for the layer to make algorithm choices on the basis of its weights, dimensions, and maximum batch size.
constexpr const char* get_output_data_type = R"trtdoc(
The dimensions passed here do not include the outermost batch size (i.e. for 2D image networks, they will be 3D CHW dimensions).
Return the DataType of the plugin output at the requested index.
The default behavior should be to return the type of the first input, or DataType::kFLOAT if the layer has no inputs.
The returned data type must have a format that is supported by the plugin.
:arg input_shapes: The shapes of the input tensors.
:arg output_shapes: The shapes of the output tensors.
:arg dtype: The data type selected for the engine.
:arg format: The format selected for the engine.
:arg max_batch_size: The maximum batch size.
)trtdoc";
:arg index: Index of the output for which Data type is requested.
:arg input_types: Data types of the inputs.
} /* IPluginExtDoc */
:returns: DataType of the plugin output at the requested index.
)trtdoc";
namespace IPluginV2Doc
{
constexpr const char* descr = R"trtdoc(
Plugin class for user-implemented layers.
constexpr const char* configure_plugin = R"trtdoc(
Configure the layer.
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.
This function is called by the :class:`Builder` prior to :func:`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 2D image networks, they will be 3D CHW dimensions).
:ivar num_outputs: :class:`int` The number of outputs from the layer. This is used by the implementations of :class:`INetworkDefinition` and :class:`Builder` . In particular, it is called prior to any call to :func:`initialize` .
:ivar tensorrt_version: :class:`int` The API version with which this plugin was built.
:ivar plugin_type: :class:`str` The plugin type. Should match the plugin name returned by the corresponding plugin creator
:ivar plugin_version: :class:`str` The plugin version. Should match the plugin version returned by the corresponding plugin creator.
:ivar plugin_namespace: :class:`str` The namespace that this plugin object belongs to. Ideally, all plugin objects from the same plugin library should have the same namespace.
:ivar serialization_size: :class:`int` The size of the serialization buffer required.
)trtdoc";
:arg input_shapes: The shapes of the input tensors.
:arg output_shapes: The shapes of the output tensors.
:arg input_types: The data types of the input tensors.
:arg output_types: The data types of the output tensors.
:arg input_is_broadcasted: Whether an input is broadcasted across the batch.
:arg output_is_broadcasted: Whether an output is broadcasted across the batch.
:arg format: The format selected for floating-point inputs and outputs of the engine.
:arg max_batch_size: The maximum batch size.
)trtdoc";
constexpr const char* get_output_shape = R"trtdoc(
Get the dimension of an output tensor.
constexpr const char* clone = R"trtdoc(
Clone the plugin object. This copies over internal plugin parameters as well and returns a new plugin object with these parameters.
:arg index: The index of the output tensor.
:arg input_shapes: The shapes of the input tensors.
If the source plugin is pre-configured with configure_plugin(), the returned object should also be pre-configured. The returned object should allow attach_to_context() with a new execution context.
Cloned plugin objects can share the same per-engine immutable resource (e.g. weights) with the source object (e.g. via ref-counting) to avoid duplication.
)trtdoc";
This function is called by the implementations of :class:`INetworkDefinition` and :class:`Builder` . In particular, it is called prior to any call to :func:`initialize` .
)trtdoc";
constexpr const char* attach_to_context = R"trtdoc(
Attach the plugin object to an execution context and grant the plugin the access to some context resource.
constexpr const char* supports_format = R"trtdoc(
Check format support.
:arg cudnn The cudnn context handle of the execution context
:arg cublas The cublas context handle of the execution context
:arg allocator The allocator used by the execution context
This function is called by the implementations of :class:`INetworkDefinition` , :class:`Builder` , and :class:`ICudaEngine` . In particular, it is called when creating an engine and when deserializing an engine.
This function is called automatically for each plugin when a new execution context is created. If the plugin needs per-context resource, it can be allocated here. The plugin can also get context-owned CUDNN and CUBLAS context here.
)trtdoc";
:arg dtype: Data type requested.
:arg format: TensorFormat requested.
constexpr const char* detach_from_context = R"trtdoc(
Detach the plugin object from its execution context.
:returns: True if the plugin supports the type-format combination.
)trtdoc";
This function is called automatically for each plugin when a execution context is destroyed. If the plugin owns per-context resource, it can be released here.
)trtdoc";
} // namespace IPluginV2ExtDoc
constexpr const char* configure_with_format = R"trtdoc(
Configure the layer.
namespace PluginFieldTypeDoc
{
constexpr const char* descr = R"trtdoc(
The possible field types for custom layer.
)trtdoc";
} // namespace PluginFieldTypeDoc
This function is called by the :class:`Builder` prior to :func:`initialize` . It provides an opportunity for the layer to make algorithm choices on the basis of its weights, dimensions, and maximum batch size.
namespace PluginFieldDoc
{
constexpr const char* descr = R"trtdoc(
Contains plugin attribute field names and associated data.
This information can be parsed to decode necessary plugin metadata
The dimensions passed here do not include the outermost batch size (i.e. for 2D image networks, they will be 3D CHW dimensions).
:ivar name: :class:`str` Plugin field attribute name.
:ivar data: :class:`buffer` Plugin field attribute data.
:ivar type: :class:`PluginFieldType` Plugin field attribute type.
:ivar size: :class:`int` Number of data entries in the Plugin attribute.
)trtdoc";
} // namespace PluginFieldDoc
:arg input_shapes: The shapes of the input tensors.
:arg output_shapes: The shapes of the output tensors.
:arg dtype: The data type selected for the engine.
:arg format: The format selected for the engine.
:arg max_batch_size: The maximum batch size.
)trtdoc";
namespace PluginFieldCollectionDoc
{
constexpr const char* descr = R"trtdoc(
Contains plugin attribute field names and associated data.
This information can be parsed to decode necessary plugin metadata
constexpr const char* initialize = R"trtdoc(
Initialize the layer for execution. This is called when the engine is created.
:ivar num_fields: :class:`int` Number of :class:`PluginField` entries.
:ivar fields: :class:`list` PluginField entries.
)trtdoc";
} // namespace PluginFieldCollectionDoc
:returns: 0 for success, else non-zero (which will cause engine termination).
)trtdoc";
namespace IPluginCreatorDoc
{
constexpr const char* descr = R"trtdoc(
Plugin creator class for user implemented layers
constexpr const char* terminate = R"trtdoc(
Release resources acquired during plugin layer initialization. This is called when the engine is destroyed.
)trtdoc";
:ivar tensorrt_version: :class:`int` Number of :class:`PluginField` entries.
:ivar name: :class:`str` Plugin name.
:ivar plugin_version: :class:`str` Plugin version.
:ivar field_names: :class:`list` List of fields that needs to be passed to :func:`create_plugin` .
:ivar plugin_namespace: :class:`str` The namespace of the plugin creator based on the plugin library it belongs to. This can be set while registering the plugin creator.
)trtdoc";
constexpr const char* get_workspace_size = R"trtdoc(
Find the workspace size required by the layer.
constexpr const char* create_plugin = R"trtdoc(
Creates a new plugin.
This function is called during engine startup, after :func:`initialize` . The workspace size returned should be sufficient for any batch size up to the maximum.
:arg name: The name of the plugin.
:arg field_collection: The :class:`PluginFieldCollection` for this plugin.
:arg max_batch_size: :class:`int` The maximum possible batch size during inference.
:returns: :class:`IPluginV2` or :class:`None` on failure.
)trtdoc";
:returns: The workspace size.
)trtdoc";
constexpr const char* deserialize_plugin = R"trtdoc(
Creates a plugin object from a serialized plugin.
constexpr const char* execute_async = R"trtdoc(
Execute the layer asynchronously.
:arg name: Name of the plugin.
:arg serialized_plugin: A buffer containing a serialized plugin.
:returns: A new :class:`IPluginV2`
)trtdoc";
} // namespace IPluginCreatorDoc
namespace IPluginRegistryDoc
{
constexpr const char* descr = R"trtdoc(
Registers plugin creators.
:ivar plugin_creator_list: All the registered plugin creators.
:ivar error_recorder: :class:`IErrorRecorder` Application-implemented error reporting interface for TensorRT objects.
)trtdoc";
constexpr const char* register_creator = R"trtdoc(
Register a plugin creator.
:arg creator: The IPluginCreator instance.
:arg plugin_namespace: The namespace of the plugin creator.
:returns: False if one with the same type is already registered.
)trtdoc";
constexpr const char* deregister_creator = R"trtdoc(
Deregister a previously registered plugin creator.
:arg batch_size: The number of inputs in the batch.
:arg inputs: The memory for the input tensors.
:arg outputs: The memory for the output tensors.
:arg workspace: Workspace for execution.
:arg stream_handle: The stream in which to execute the kernels.
Since there may be a desire to limit the number of plugins,
this function provides a mechanism for removing plugin creators registered in TensorRT.
The plugin creator that is specified by ``creator`` is removed from TensorRT and no longer tracked.
:arg creator: The IPluginCreator instance.
:returns: ``True`` if the plugin creator was deregistered, ``False`` if it was not found in the registry
or otherwise could not be deregistered.
)trtdoc";
constexpr const char* get_plugin_creator = R"trtdoc(
Return plugin creator based on type and version
:arg type: The type of the plugin.
:arg version: The version of the plugin.
:arg plugin_namespace: The namespace of the plugin.
:returns: An :class:`IPluginCreator` .
)trtdoc";
} // namespace IPluginRegistryDoc
namespace FreeFunctionsDoc
{
constexpr const char* get_plugin_registry = R"trtdoc(
Return the plugin registry
)trtdoc";
constexpr const char* init_libnvinfer_plugins = R"trtdoc(
Initialize and register all the existing TensorRT plugins to the :class:`IPluginRegistry` with an optional namespace.
The plugin library author should ensure that this function name is unique to the library.
This function should be called once before accessing the Plugin Registry.
:returns: 0 for success, else non-zero (which will cause engine termination).
)trtdoc";
:arg logger: Logger to print plugin registration information.
:arg namespace: Namespace used to register all the plugins in this library.
)trtdoc";
} // namespace FreeFunctionsDoc
constexpr const char* serialize = R"trtdoc(
Serialize the plugin.
)trtdoc";
constexpr const char* destroy = R"trtdoc(
Destroy the plugin object. This will be called when the :class:`INetworkDefinition` , :class:`Builder` or :class:`ICudaEngine` is destroyed.
)trtdoc";
constexpr const char* clone = R"trtdoc(
Clone the plugin object. This copies over internal plugin parameters and returns a new plugin object with these parameters.
)trtdoc";
} /* IPluginV2Doc */
namespace IPluginV2ExtDoc
{
constexpr const char* descr = R"trtdoc(
Plugin class for user-implemented layers.
Plugins are a mechanism for applications to implement custom layers. This interface provides additional capabilities to the IPluginV2 interface by supporting different output data types.
:ivar tensorrt_version: :class:`int` The API version with which this plugin was built.
)trtdoc";
constexpr const char* get_output_data_type = R"trtdoc(
Return the DataType of the plugin output at the requested index.
The default behavior should be to return the type of the first input, or DataType::kFLOAT if the layer has no inputs.
The returned data type must have a format that is supported by the plugin.
:arg index: Index of the output for which Data type is requested.
:arg input_types: Data types of the inputs.
:returns: DataType of the plugin output at the requested index.
)trtdoc";
constexpr const char* configure_plugin = R"trtdoc(
Configure the layer.
This function is called by the :class:`Builder` prior to :func:`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 2D image networks, they will be 3D CHW dimensions).
:arg input_shapes: The shapes of the input tensors.
:arg output_shapes: The shapes of the output tensors.
:arg input_types: The data types of the input tensors.
:arg output_types: The data types of the output tensors.
:arg input_is_broadcasted: Whether an input is broadcasted across the batch.
:arg output_is_broadcasted: Whether an output is broadcasted across the batch.
:arg format: The format selected for floating-point inputs and outputs of the engine.
:arg max_batch_size: The maximum batch size.
)trtdoc";
constexpr const char* clone = R"trtdoc(
Clone the plugin object. This copies over internal plugin parameters as well and returns a new plugin object with these parameters.
If the source plugin is pre-configured with configure_plugin(), the returned object should also be pre-configured. The returned object should allow attach_to_context() with a new execution context.
Cloned plugin objects can share the same per-engine immutable resource (e.g. weights) with the source object (e.g. via ref-counting) to avoid duplication.
)trtdoc";
constexpr const char* attach_to_context = R"trtdoc(
Attach the plugin object to an execution context and grant the plugin the access to some context resource.
:arg cudnn The cudnn context handle of the execution context
:arg cublas The cublas context handle of the execution context
:arg allocator The allocator used by the execution context
This function is called automatically for each plugin when a new execution context is created. If the plugin needs per-context resource, it can be allocated here. The plugin can also get context-owned CUDNN and CUBLAS context here.
)trtdoc";
constexpr const char* detach_from_context = R"trtdoc(
Detach the plugin object from its execution context.
This function is called automatically for each plugin when a execution context is destroyed. If the plugin owns per-context resource, it can be released here.
)trtdoc";
} /* IPluginExtDoc */
namespace PluginFieldTypeDoc
{
constexpr const char* descr = R"trtdoc(
The possible field types for custom layer.
)trtdoc";
} /* PluginFieldTypeDoc */
namespace PluginFieldDoc
{
constexpr const char* descr = R"trtdoc(
Contains plugin attribute field names and associated data.
This information can be parsed to decode necessary plugin metadata
:ivar name: :class:`str` Plugin field attribute name.
:ivar data: :class:`buffer` Plugin field attribute data.
:ivar type: :class:`PluginFieldType` Plugin field attribute type.
:ivar size: :class:`int` Number of data entries in the Plugin attribute.
)trtdoc";
} /* PluginFieldDoc */
namespace PluginFieldCollectionDoc
{
constexpr const char* descr = R"trtdoc(
Contains plugin attribute field names and associated data.
This information can be parsed to decode necessary plugin metadata
:ivar num_fields: :class:`int` Number of :class:`PluginField` entries.
:ivar fields: :class:`list` PluginField entries.
)trtdoc";
} /* PluginFieldCollectionDoc */
namespace IPluginCreatorDoc
{
constexpr const char* descr = R"trtdoc(
Plugin creator class for user implemented layers
:ivar tensorrt_version: :class:`int` Number of :class:`PluginField` entries.
:ivar name: :class:`str` Plugin name.
:ivar plugin_version: :class:`str` Plugin version.
:ivar field_names: :class:`list` List of fields that needs to be passed to :func:`create_plugin` .
:ivar plugin_namespace: :class:`str` The namespace of the plugin creator based on the plugin library it belongs to. This can be set while registering the plugin creator.
)trtdoc";
constexpr const char* create_plugin = R"trtdoc(
Creates a new plugin.
:arg name: The name of the plugin.
:arg field_collection: The :class:`PluginFieldCollection` for this plugin.
:returns: :class:`IPluginV2` or :class:`None` on failure.
)trtdoc";
constexpr const char* deserialize_plugin = R"trtdoc(
Creates a plugin object from a serialized plugin.
:arg name: Name of the plugin.
:arg serialized_plugin: A buffer containing a serialized plugin.
:returns: A new :class:`IPluginV2`
)trtdoc";
} /* IPluginCreatorDoc */
namespace IPluginRegistryDoc
{
constexpr const char* descr = R"trtdoc(
Registers plugin creators.
:ivar plugin_creator_list: All the registered plugin creators.
)trtdoc";
constexpr const char* register_creator = R"trtdoc(
Register a plugin creator.
:arg creator: The IPluginCreator instance.
:arg plugin_namespace: The namespace of the plugin creator.
:returns: False if one with the same type is already registered.
)trtdoc";
constexpr const char* get_plugin_creator = R"trtdoc(
Return plugin creator based on type and version
:arg type: The type of the plugin.
:arg version: The version of the plugin.
:arg plugin_namespace: The namespace of the plugin.
:returns: An :class:`IPluginCreator` .
)trtdoc";
} /* IPluginRegistryDoc */
namespace FreeFunctionsDoc
{
constexpr const char* get_plugin_registry = R"trtdoc(
Return the plugin registry
)trtdoc";
constexpr const char* init_libnvinfer_plugins = R"trtdoc(
Initialize and register all the existing TensorRT plugins to the :class:`IPluginRegistry` with an optional namespace.
The plugin library author should ensure that this function name is unique to the library.
This function should be called once before accessing the Plugin Registry.
:arg logger: Logger to print plugin registration information.
:arg namespace: Namespace used to register all the plugins in this library.
)trtdoc";
} /* FreeFunctionsDoc */
namespace IPluginFactoryDoc
{
constexpr const char* descr = R"trtdoc(
Plugin factory for deserialization
)trtdoc";
constexpr const char* create_plugin = R"trtdoc(
Create a plugin from serialized data.
Responsibility of destroying this plugin lies with the application. It can be done anytime after consumers of this plugin are destroyed.
:arg layer_name: The name of the layer.
:arg serialized_plugin: The serialized plugin.
:returns: The plugin.
)trtdoc";
} /* IPluginFactoryDoc */
} /* tensorrt */
} // namespace tensorrt
+66 -111
View File
@@ -19,137 +19,92 @@
namespace tensorrt
{
namespace ICaffeParserDoc
{
constexpr const char* descr = R"trtdoc(
This class is used for parsing Caffe models. It allows users to export models trained using Caffe to TRT.
namespace ICaffeParserDoc
{
constexpr const char* descr = R"trtdoc(
This class is used for parsing Caffe models. It allows users to export models trained using Caffe to TRT.
:ivar plugin_factory: :class:`ICaffePluginFactory` The ICaffePluginFactory used to create the user defined plugins.
:ivar plugin_factory_ext: :class:`ICaffePluginFactoryExt` The ICaffePluginFactoryExt used to create the user defined pluginExts.
:ivar plugin_factory_v2: :class:`ICaffePluginFactoryV2` The ICaffePluginFactory used to create the user defined plugins.
:ivar plugin_namespace: :class:`str` The namespace used to lookup and create plugins in the network.
:ivar protobuf_buffer_size: :class:`int` The buffer size for the parsing and storage of the learned model.
)trtdoc";
:ivar plugin_factory_v2: :class:`ICaffePluginFactoryV2` The ICaffePluginFactory used to create the user defined plugins.
:ivar plugin_namespace: :class:`str` The namespace used to lookup and create plugins in the network.
:ivar protobuf_buffer_size: :class:`int` The buffer size for the parsing and storage of the learned model.
:ivar error_recorder: :class:`IErrorRecorder` Application-implemented error reporting interface for TensorRT objects.
)trtdoc";
constexpr const char* parse = R"trtdoc(
Parse a prototxt file and a binaryproto Caffe model to extract network definition and weights associated with the network, respectively.
constexpr const char* parse = R"trtdoc(
Parse a prototxt file and a binaryproto Caffe model to extract network definition and weights associated with the network, respectively.
:arg deploy: The plain text, prototxt file used to define the network definition.
:arg model: The binaryproto Caffe model that contains the weights associated with the network.
:arg network: Network in which the CaffeParser will fill the layers.
:arg dtype: The type to which the weights will be transformed.
:arg deploy: The plain text, prototxt file used to define the network definition.
:arg model: The binaryproto Caffe model that contains the weights associated with the network.
:arg network: Network in which the CaffeParser will fill the layers.
:arg dtype: The type to which the weights will be transformed.
:returns: An :class:`IBlobNameToTensor` object that contains the extracted data.
)trtdoc";
:returns: An :class:`IBlobNameToTensor` object that contains the extracted data.
)trtdoc";
constexpr const char* parse_buffer = R"trtdoc(
Parse a prototxt file and a binaryproto Caffe model to extract network definition and weights associated with the network, respectively.
constexpr const char* parse_buffer = R"trtdoc(
Parse a prototxt file and a binaryproto Caffe model to extract network definition and weights associated with the network, respectively.
:arg deploy_buffer: The memory buffer containing the plain text deploy prototxt used to define the network definition.
:arg model_buffer: The binaryproto Caffe memory buffer that contains the weights associated with the network.
:arg network: Network in which the CaffeParser will fill the layers.
:arg dtype: The type to which the weights will be transformed.
:arg deploy_buffer: The memory buffer containing the plain text deploy prototxt used to define the network definition.
:arg model_buffer: The binaryproto Caffe memory buffer that contains the weights associated with the network.
:arg network: Network in which the CaffeParser will fill the layers.
:arg dtype: The type to which the weights will be transformed.
:returns: An :class:`IBlobNameToTensor` object that contains the extracted data.
)trtdoc";
:returns: An :class:`IBlobNameToTensor` object that contains the extracted data.
)trtdoc";
constexpr const char* parse_binary_proto = R"trtdoc(
Parse and extract data stored in binaryproto file. The binaryproto file contains data stored in a binary blob. :func:`parse_binary_proto` converts it to an :class:`numpy.ndarray` object.
constexpr const char* parse_binary_proto = R"trtdoc(
Parse and extract data stored in binaryproto file. The binaryproto file contains data stored in a binary blob. :func:`parse_binary_proto` converts it to an :class:`numpy.ndarray` object.
:arg filename: Path to file containing binary proto.
:arg filename: Path to file containing binary proto.
:returns: :class:`numpy.ndarray` An array that contains the extracted data.
)trtdoc";
:returns: :class:`numpy.ndarray` An array that contains the extracted data.
)trtdoc";
} /* ICaffeParserDoc */
} // namespace ICaffeParserDoc
namespace IBlobNameToTensorDoc
{
constexpr const char* descr = R"trtdoc(
This class is used to store and query :class:`ITensor` s after they have been extracted from a Caffe model using the :class:`CaffeParser` .
)trtdoc";
namespace IBlobNameToTensorDoc
{
constexpr const char* descr = R"trtdoc(
This class is used to store and query :class:`ITensor` s after they have been extracted from a Caffe model using the :class:`CaffeParser` .
)trtdoc";
constexpr const char* find = R"trtdoc(
Given a blob name, this function returns an :class:`ITensor` object.
constexpr const char* find = R"trtdoc(
Given a blob name, this function returns an :class:`ITensor` object.
:arg name: Caffe blob name for which the user wants the corresponding :class:`ITensor` .
:arg name: Caffe blob name for which the user wants the corresponding :class:`ITensor` .
:returns: A :class:`ITensor` object corresponding to the queried name. If no such :class:`ITensor` exists, then an empty object is returned.
)trtdoc";
} /* IBlobNameToTensorDoc */
:returns: A :class:`ITensor` object corresponding to the queried name. If no such :class:`ITensor` exists, then an empty object is returned.
)trtdoc";
} // namespace IBlobNameToTensorDoc
namespace ICaffePluginFactoryDoc
{
constexpr const char* descr = R"trtdoc(
Plugin factory used to configure plugins.
)trtdoc";
namespace ICaffePluginFactoryV2Doc
{
constexpr const char* descr = R"trtdoc(
Plugin factory used to configure plugins.
)trtdoc";
constexpr const char* is_plugin = R"trtdoc(
A user implemented function that determines if a layer configuration is provided by an :class:`IPlugin` .
constexpr const char* is_plugin_v2 = R"trtdoc(
A user implemented function that determines if a layer configuration is provided by an :class:`IPluginV2` .
:arg layer_name: Name of the layer which the user wishes to validate.
:arg layer_name: Name of the layer which the user wishes to validate.
:returns: True if the the layer configuration is provided by an :class:`IPlugin` .
)trtdoc";
:returns: True if the the layer configuration is provided by an :class:`IPluginV2` .
)trtdoc";
constexpr const char* create_plugin = R"trtdoc(
Creates a plugin.
constexpr const char* create_plugin = R"trtdoc(
Creates a plugin.
:arg layer_name: Name of layer associated with the plugin.
:arg weights: Weights used for the layer.
:arg layer_name: Name of layer associated with the plugin.
:arg weights: Weights used for the layer.
:returns: The newly created :class:`IPlugin` .
)trtdoc";
} //IPluginFactoryExtDoc
:returns: The newly created :class:`IPluginV2` .
)trtdoc";
} // namespace ICaffePluginFactoryV2Doc
namespace ICaffePluginFactoryExtDoc
{
constexpr const char* descr = R"trtdoc(
Plugin factory used to configure plugins with added support for TRT versioning.
)trtdoc";
constexpr const char* is_plugin_ext = R"trtdoc(
A user implemented function that determines if a layer configuration is provided by an :class:`IPluginExt` .
:arg layer_name: Name of the layer which the user wishes to validate.
:returns: True if the the layer configuration is provided by an :class:`IPluginExt` .
)trtdoc";
constexpr const char* get_version = R"trtdoc(
Get the Tensorrt Version.
)trtdoc";
} //IPluginFactoryExtDoc
namespace ICaffePluginFactoryV2Doc
{
constexpr const char* descr = R"trtdoc(
Plugin factory used to configure plugins.
)trtdoc";
constexpr const char* is_plugin_v2 = R"trtdoc(
A user implemented function that determines if a layer configuration is provided by an :class:`IPluginV2` .
:arg layer_name: Name of the layer which the user wishes to validate.
:returns: True if the the layer configuration is provided by an :class:`IPluginV2` .
)trtdoc";
constexpr const char* create_plugin = R"trtdoc(
Creates a plugin.
:arg layer_name: Name of layer associated with the plugin.
:arg weights: Weights used for the layer.
:returns: The newly created :class:`IPluginV2` .
)trtdoc";
} //IPluginFactoryV2Doc
namespace FreeFunctionsDoc
{
constexpr const char* shutdown_protobuf_library = R"trtdoc(
Shuts down protocol buffers library.
)trtdoc";
}
} /* tensorrt */
namespace FreeFunctionsDoc
{
constexpr const char* shutdown_protobuf_library = R"trtdoc(
Shuts down protocol buffers library.
)trtdoc";
}
} // namespace tensorrt
+94 -89
View File
@@ -14,127 +14,132 @@
* limitations under the License.
*/
// Docstrings for the pyCaffe parser bindings.
#pragma once
namespace tensorrt
{
namespace OnnxParserDoc
{
constexpr const char* descr = R"trtdoc(
This class is used for parsing ONNX models into a TensorRT network definition
constexpr const char* descr = R"trtdoc(
This class is used for parsing ONNX models into a TensorRT network definition
:ivar num_errors: :class:`int` The number of errors that occurred during prior calls to :func:`parse`
)trtdoc";
:ivar num_errors: :class:`int` The number of errors that occurred during prior calls to :func:`parse`
)trtdoc";
constexpr const char* init = R"trtdoc(
:arg network: The network definition to which the parser will write.
:arg logger: The logger to use.
)trtdoc";
constexpr const char* init = R"trtdoc(
:arg network: The network definition to which the parser will write.
:arg logger: The logger to use.
)trtdoc";
constexpr const char* parse = R"trtdoc(
Parse a serialized ONNX model into the TensorRT network.
constexpr const char* parse = R"trtdoc(
Parse a serialized ONNX model into the TensorRT network.
:arg model: The serialized ONNX model.
:arg path: The path to the model file. Only required if the model has externally stored weights.
:arg model: The serialized ONNX model.
:arg path: The path to the model file. Only required if the model has externally stored weights.
:returns: true if the model was parsed successfully
)trtdoc";
:returns: true if the model was parsed successfully
)trtdoc";
constexpr const char* parseFromFile = R"trtdoc(
Parse an ONNX model from file into a TensorRT network.
constexpr const char* parse_with_weight_descriptors = R"trtdoc(
Parse a serialized ONNX model into the TensorRT network with consideration of user provided weights.
:arg model: The path to an ONNX model.
:arg model: The serialized ONNX model.
:returns: true if the model was parsed successfully
)trtdoc";
:returns: true if the model was parsed successfully
)trtdoc";
constexpr const char* supports_model = R"trtdoc(
Check whether TensorRT supports a particular ONNX model.
constexpr const char* parse_from_file = R"trtdoc(
Parse an ONNX model from file into a TensorRT network.
:arg model: The serialized ONNX model.
:arg path: The path to the model file. Only required if the model has externally stored weights.
:arg model: The path to an ONNX model.
:returns: Tuple[bool, List[Tuple[NodeIndices, bool]]]
The first element of the tuple indicates whether the model is supported.
The second indicates subgraphs (by node index) in the model and whether they are supported.
)trtdoc";
:returns: true if the model was parsed successfully
)trtdoc";
constexpr const char* supports_operator = R"trtdoc(
Returns whether the specified operator may be supported by the parser.
Note that a result of true does not guarantee that the operator will be supported in all cases. A more accurate report can be generated by supports_model().
constexpr const char* supports_model = R"trtdoc(
Check whether TensorRT supports a particular ONNX model.
:arg op_name: The name of the ONNX operator to check for support
)trtdoc";
:arg model: The serialized ONNX model.
:arg path: The path to the model file. Only required if the model has externally stored weights.
constexpr const char* get_error = R"trtdoc(
Get an error that occurred during prior calls to :func:`parse`
:returns: Tuple[bool, List[Tuple[NodeIndices, bool]]]
The first element of the tuple indicates whether the model is supported.
The second indicates subgraphs (by node index) in the model and whether they are supported.
)trtdoc";
:arg index: Index of the error
)trtdoc";
constexpr const char* supports_operator = R"trtdoc(
Returns whether the specified operator may be supported by the parser.
Note that a result of true does not guarantee that the operator will be supported in all cases (i.e., this function may return false-positives).
constexpr const char* clear_errors = R"trtdoc(
Clear errors from prior calls to :func:`parse`
)trtdoc";
:arg op_name: The name of the ONNX operator to check for support
)trtdoc";
constexpr const char* get_refit_map = R"trtdoc(
Get description of all weights that could be refit.
:returns: The names of ONNX weights that can be refitted, along with their corresponding TensorRT layer and weight role.
)trtdoc";
} /* OnnxParserDoc */
constexpr const char* get_error = R"trtdoc(
Get an error that occurred during prior calls to :func:`parse`
namespace ErrorCodeDoc
{
constexpr const char* descr = R"trtdoc(
The type of parser error
)trtdoc";
} /* ErrorCodeDoc */
:arg index: Index of the error
)trtdoc";
namespace ParserErrorDoc
{
constexpr const char* descr = R"trtdoc(
An object containing information about an error
)trtdoc";
constexpr const char* clear_errors = R"trtdoc(
Clear errors from prior calls to :func:`parse`
)trtdoc";
constexpr const char* code = R"trtdoc(
:returns: The error code
)trtdoc";
} // namespace OnnxParserDoc
constexpr const char* desc = R"trtdoc(
:returns: Description of the error
)trtdoc";
namespace ErrorCodeDoc
{
constexpr const char* descr = R"trtdoc(
The type of parser error
)trtdoc";
} // namespace ErrorCodeDoc
constexpr const char* file = R"trtdoc(
:returns: Source file in which the error occurred
)trtdoc";
namespace ParserErrorDoc
{
constexpr const char* descr = R"trtdoc(
An object containing information about an error
)trtdoc";
constexpr const char* line = R"trtdoc(
:returns: Source line at which the error occurred
)trtdoc";
constexpr const char* code = R"trtdoc(
:returns: The error code
)trtdoc";
constexpr const char* func = R"trtdoc(
:returns: Source function in which the error occurred
)trtdoc";
constexpr const char* desc = R"trtdoc(
:returns: Description of the error
)trtdoc";
constexpr const char* node = R"trtdoc(
:returns: Index of the Onnx model node in which the error occurred
)trtdoc";
} /* IParserErrorDoc */
constexpr const char* file = R"trtdoc(
:returns: Source file in which the error occurred
)trtdoc";
constexpr const char* get_nv_onnx_parser_version = R"trtdoc(
:returns: The Onnx version
)trtdoc";
constexpr const char* line = R"trtdoc(
:returns: Source line at which the error occurred
)trtdoc";
namespace IOnnxPluginFactoryDoc
{
constexpr const char* descr = R"trtdoc(
This plugin factory handles deserialization of the plugins that are built
into the ONNX parser. Engines with legacy plugin layers built using the ONNX parser
must use this plugin factory during deserialization.
)trtdoc";
constexpr const char* func = R"trtdoc(
:returns: Source function in which the error occurred
)trtdoc";
constexpr const char* init = R"trtdoc(
:arg logger: The logger to use.
)trtdoc";
} /* IOnnxPluginFactoryDoc */
constexpr const char* node = R"trtdoc(
:returns: Index of the Onnx model node in which the error occurred
)trtdoc";
} // namespace ParserErrorDoc
} /* tensorrt */
constexpr const char* get_nv_onnx_parser_version = R"trtdoc(
:returns: The Onnx version
)trtdoc";
namespace IOnnxPluginFactoryDoc
{
constexpr const char* descr = R"trtdoc(
This plugin factory handles deserialization of the plugins that are built
into the ONNX parser. Engines with legacy plugin layers built using the ONNX parser
must use this plugin factory during deserialization.
)trtdoc";
constexpr const char* init = R"trtdoc(
:arg logger: The logger to use.
)trtdoc";
} // namespace IOnnxPluginFactoryDoc
} // namespace tensorrt
+68 -113
View File
@@ -18,141 +18,96 @@
namespace tensorrt
{
namespace UffInputOrderDoc
{
constexpr const char* descr = R"trtdoc(
The different possible supported input orders.
)trtdoc";
namespace UffInputOrderDoc
{
constexpr const char* descr = R"trtdoc(
The different possible supported input orders.
)trtdoc";
} /* UffInputOrder */
} // namespace UffInputOrderDoc
namespace FieldTypeDoc
{
constexpr const char* descr = R"trtdoc(
The possible field types for the custom layer.
)trtdoc";
namespace FieldTypeDoc
{
constexpr const char* descr = R"trtdoc(
The possible field types for the custom layer.
)trtdoc";
} /* FieldType */
} // namespace FieldTypeDoc
namespace FieldMapDoc
{
constexpr const char* descr = R"trtdoc(
This is a class containing an array of field params used as a layer parameter for plugin layers. The node fields are passed by the parser to the API through the plugin constructor. The implementation of the plugin should parse the contents of the :class:`FieldMap` as part of the plugin constructor.
namespace FieldMapDoc
{
constexpr const char* descr = R"trtdoc(
This is a class containing an array of field params used as a layer parameter for plugin layers. The node fields are passed by the parser to the API through the plugin constructor. The implementation of the plugin should parse the contents of the :class:`FieldMap` as part of the plugin constructor.
:ivar name: :class:`str` field param
:ivar data: :class:`capsule` field param
:ivar type: :class:`FieldType` field param
:ivar length: :class:`int` field param
)trtdoc";
:ivar name: :class:`str` field param
:ivar data: :class:`capsule` field param
:ivar type: :class:`FieldType` field param
:ivar length: :class:`int` field param
)trtdoc";
} /* FieldMap */
} // namespace FieldMapDoc
namespace FieldCollectionDoc
{
constexpr const char* descr = R"trtdoc(
This class contains an array of :class:`FieldMap` s.
namespace FieldCollectionDoc
{
constexpr const char* descr = R"trtdoc(
This class contains an array of :class:`FieldMap` s.
:ivar num_fields: :class:`int` The number of :class:`FieldMap` s.
:ivar fields: :class:`capsule` The array of :class:`FieldMap` s.
)trtdoc";
:ivar num_fields: :class:`int` The number of :class:`FieldMap` s.
:ivar fields: :class:`capsule` The array of :class:`FieldMap` s.
)trtdoc";
} /* FieldCollection */
} // namespace FieldCollectionDoc
namespace IUffPluginFactoryDoc
{
constexpr const char* descr = R"trtdoc(
Plugin factory used to configure plugins.
)trtdoc";
namespace UffParserDoc
{
constexpr const char* is_plugin = R"trtdoc(
A user implemented function that determines if a layer configuration is provided by an :class:`IPlugin` .
constexpr const char* descr = R"trtdoc(
This class is used for parsing models described using the UFF format.
:arg layer_name: Name of the layer which the user wishes to validate.
:ivar uff_required_version_major: :class:`int` Version Major of the UFF.
:ivar uff_required_version_minor: :class:`int` Version Minor of the UFF.
:ivar uff_required_version_patch: :class:`int` Version Patch of the UFF.
:ivar plugin_namespace: :class:`str` The namespace used to lookup and create plugins in the network.
:ivar error_recorder: :class:`IErrorRecorder` Application-implemented error reporting interface for TensorRT objects.
)trtdoc";
:returns: True if the the layer configuration is provided by an :class:`IPlugin` .
)trtdoc";
constexpr const char* register_input = R"trtdoc(
Register an input name of a UFF network with the associated Dimensions.
constexpr const char* create_plugin = R"trtdoc(
Creates a plugin.
:arg name: Input name.
:arg shape: Input shape.
:arg order: Input order on which the framework input was originally.
:arg layer_name: Name of layer associated with the plugin.
:arg weights: Weights used for the layer.
:arg field_collection: A collection of FieldMaps used as layer parameters for different plugin layers.
:returns: True if the name registers without error.
)trtdoc";
:returns: The newly created :class:`IPlugin` .
)trtdoc";
} //IPluginFactoryExtDoc
constexpr const char* register_output = R"trtdoc(
Register an output name of a UFF network.
namespace IUffPluginFactoryExtDoc
{
constexpr const char* descr = R"trtdoc(
Plugin factory used to configure plugins with added support for TRT versioning.
)trtdoc";
:arg output_name: Output name.
constexpr const char* is_plugin_ext = R"trtdoc(
A user implemented function that determines if a layer configuration is provided by an :class:`IPluginExt` .
:returns: True if the name registers without error.
)trtdoc";
:arg layer_name: Name of the layer which the user wishes to validate.
constexpr const char* parse = R"trtdoc(
Parse a UFF file.
:returns: True if the the layer configuration is provided by an :class:`IPluginExt` .
)trtdoc";
:arg file: File name of the UFF file.
:arg network: Network in which the :class:`UffParser` will fill the layers.
:arg weights_type: The type on which the weights will be transformed in.
constexpr const char* get_version = R"trtdoc(
Get the Tensorrt Version
)trtdoc";
} //IPluginFactoryExtDoc
:returns: True if the UFF file is parsed without error.
)trtdoc";
namespace UffParserDoc
{
constexpr const char* parse_buffer = R"trtdoc(
Parse a UFF buffer - useful if the file is already live in memory.
constexpr const char* descr = R"trtdoc(
This class is used for parsing models described using the UFF format.
:arg buffer: The UFF buffer.
:arg network: Network in which the UFFParser will fill the layers.
:arg weights_type: The type on which the weights will be transformed in.
:ivar uff_required_version_major: :class:`int` Version Major of the UFF.
:ivar uff_required_version_minor: :class:`int` Version Minor of the UFF.
:ivar uff_required_version_patch: :class:`int` Version Patch of the UFF.
:ivar plugin_factory: :class:`IUffPluginFactory` used to create the user defined plugins.
:ivar plugin_factory_ext: :class:`IUffPluginFactoryExt` used to create the user defined pluginExts.
:ivar plugin_namespace: :class:`str` The namespace used to lookup and create plugins in the network.
)trtdoc";
:returns: True if the UFF buffer is parsed without error.
)trtdoc";
} // namespace UffParserDoc
constexpr const char* register_input = R"trtdoc(
Register an input name of a UFF network with the associated Dimensions.
:arg name: Input name.
:arg shape: Input shape.
:arg order: Input order on which the framework input was originally.
:returns: True if the name registers without error.
)trtdoc";
constexpr const char* register_output = R"trtdoc(
Register an output name of a UFF network.
:arg output_name: Output name.
:returns: True if the name registers without error.
)trtdoc";
constexpr const char* parse = R"trtdoc(
Parse a UFF file.
:arg file: File name of the UFF file.
:arg network: Network in which the :class:`UffParser` will fill the layers.
:arg weights_type: The type on which the weights will be transformed in.
:returns: True if the UFF file is parsed without error.
)trtdoc";
constexpr const char* parse_buffer = R"trtdoc(
Parse a UFF buffer - useful if the file is already live in memory.
:arg buffer: The UFF buffer.
:arg network: Network in which the UFFParser will fill the layers.
:arg weights_type: The type on which the weights will be transformed in.
:returns: True if the UFF buffer is parsed without error.
)trtdoc";
} /* UffParserDoc */
} /* tensorrt */
} // namespace tensorrt
+2 -2
View File
@@ -19,5 +19,5 @@
namespace tensorrt
{
} /* tensorrt */
} // namespace tensorrt