◆ __init__()
def polygraphy.backend.trt.loader.CreateConfig.__init__ |
( |
|
self, |
|
|
|
max_workspace_size = None , |
|
|
|
tf32 = None , |
|
|
|
fp16 = None , |
|
|
|
int8 = None , |
|
|
|
profiles = None , |
|
|
|
calibrator = None , |
|
|
|
strict_types = None |
|
) |
| |
Functor that creates a TensorRT IBuilderConfig.
Args:
max_workspace_size (int): The maximum workspace size, in bytes, when building the engine.
tf32 (bool): Whether to build the engine with TF32 precision enabled. Defaults to False.
fp16 (bool): Whether to build the engine with FP16 precision enabled. Defaults to False.
int8 (bool): Whether to build the engine with INT8 precision enabled. Defaults to False.
profiles (List[Profile]):
A list of optimization profiles to add to the configuration. Only needed for
networks with dynamic input shapes. If this is omitted for a network with
dynamic shapes, a default profile is created, where dynamic dimensions are
replaced with Polygraphy's DEFAULT_SHAPE_VALUE (defined in util/constants.py).
See `Profile` for details.
calibrator (trt.IInt8Calibrator):
An int8 calibrator. Only required in int8 mode when
the network does not have explicit precision. For networks with
dynamic shapes, the last profile provided (or default profile if
no profiles are provided) is used during calibration.
◆ __call__()
def polygraphy.backend.trt.loader.CreateConfig.__call__ |
( |
|
self, |
|
|
|
builder, |
|
|
|
network |
|
) |
| |
Creates a TensorRT IBuilderConfig that can be used by the EngineFromNetwork.
Args:
builder (trt.Builder):
The TensorRT builder to use to create the configuration.
network (trt.INetworkDefinition):
The TensorRT network for which to create the config. The network is used to
automatically create a default optimization profile if none are provided.
Returns:
trt.IBuilderConfig: The TensorRT builder configuration.
◆ max_workspace_size
polygraphy.backend.trt.loader.CreateConfig.max_workspace_size |
◆ tf32
polygraphy.backend.trt.loader.CreateConfig.tf32 |
◆ fp16
polygraphy.backend.trt.loader.CreateConfig.fp16 |
◆ int8
polygraphy.backend.trt.loader.CreateConfig.int8 |
◆ profiles
polygraphy.backend.trt.loader.CreateConfig.profiles |
◆ calibrator
polygraphy.backend.trt.loader.CreateConfig.calibrator |
◆ strict_types
polygraphy.backend.trt.loader.CreateConfig.strict_types |
The documentation for this class was generated from the following file: