Builder

class tensorrt.Builder(self: tensorrt.tensorrt.Builder, logger: tensorrt.tensorrt.ILogger) → None

Builds an ICudaEngine from a INetworkDefinition .

Variables:
  • max_batch_sizeint The maximum batch size which can be used at execution time, and also the batch size for which the ICudaEngine will be optimized.
  • max_workspace_sizeint The maximum GPU temporary memory which the ICudaEngine can use at execution time.
  • debug_syncbool Whether the Builder should use debug synchronization. If this is true, the Builder will synchronize after timing each layer, and report the layer name. It can be useful when diagnosing issues at build time.
  • min_find_iterationsint The number of minimization iterations used when timing layers. When timing layers, the Builder minimizes over a set of average times for layer execution. This parameter controls the number of iterations used in minimization.
  • average_find_iterationsint The number of averaging iterations used when timing layers. When timing layers, the Builder minimizes over a set of average times for layer execution. This parameter controls the number of iterations used in averaging.
  • platform_has_fast_fp16bool Whether the platform has fast native fp16.
  • platform_has_fast_int8bool Whether the platform has fast native int8.
  • int8_modebool Whether Int8 mode is used.
  • int8_calibratorIInt8Calibrator The Int8 Calibration interface.
  • fp16_modebool Whether or not 16-bit kernels are permitted. During ICudaEngine build fp16 kernels will also be tried when this mode is enabled.
  • strict_type_constraintsbool When strict type constraints is set, TensorRT will choose the type constraints that conforms to type constraints. If the flag is not enabled higher precision implementation may be chosen if it results in higher performance.
Parameters:

logger – The logger to use. This should be a derived class of ILogger .

build_cuda_engine(self: tensorrt.tensorrt.Builder, network: tensorrt.tensorrt.INetworkDefinition) → tensorrt.tensorrt.ICudaEngine

Builds an ICudaEngine from a INetworkDefinition .

Parameters:network – The TensorRT INetworkDefinition .
Returns:A new ICudaEngine .
create_network(self: tensorrt.tensorrt.Builder) → tensorrt.tensorrt.INetworkDefinition

Create a INetworkDefinition object.

Returns:An empty TensorRT INetworkDefinition .