◆ __init__()
def polygraphy.backend.trt.loader.EngineFromNetwork.__init__ |
( |
|
self, |
|
|
|
network, |
|
|
|
config = None |
|
) |
| |
Functor that uses a TensorRT ``INetworkDefinition`` to build an engine.
Args:
network (Callable() -> trt.Builder, trt.INetworkDefinition):
A callable capable of returning a TensorRT Builder and INetworkDefinition. The returned builder
and network are owned by EngineFromNetwork and should not be freed manually. The callable may
have at most 3 return values if another object needs to be kept alive for the duration of the network,
e.g., in the case of a parser. EngineFromNetwork will take ownership of the third return value, and,
like the network, it should not be freed by the callable. The first and second return values must
always be the builder and network respectively.
If instead of a loader, the network, builder, and optional parser arguments are provided directly,
then EngineFromNetwork will *not* deallocate them.
config (Callable(trt.Builder, trt.INetworkDefinition) -> trt.IBuilderConfig):
A callable that returns a TensorRT builder configuration. If not supplied,
a `CreateConfig` instance with default parameters is used.
◆ __call__()
def polygraphy.backend.trt.loader.EngineFromNetwork.__call__ |
( |
|
self | ) |
|
Builds a TensorRT engine.
Returns:
trt.ICudaEngine: The engine that was created.
◆ _network
polygraphy.backend.trt.loader.EngineFromNetwork._network |
|
private |
◆ _config
polygraphy.backend.trt.loader.EngineFromNetwork._config |
|
private |
The documentation for this class was generated from the following file: