Struct async_tensorrt::builder::Builder
source · pub struct Builder { /* private fields */ }
Expand description
Builds an engine from a network definition.
Implementations§
source§impl Builder
impl Builder
sourcepub fn add_optimization_profile(&mut self) -> Result<(), Error>
pub fn add_optimization_profile(&mut self) -> Result<(), Error>
Create a new optimization profile.
Note that the official TensorRT documentation states:
“If the network has any dynamic input tensors, the appropriate calls to setDimensions() must be made.”
But this part of the API has not been implemented yet in async-tensorrt
.
This function is still useful to allocate the optimization profile in the Builder
, which
may or may not actually affect the building process later.
sourcepub fn with_optimization_profile(self) -> Result<Self, Error>
pub fn with_optimization_profile(self) -> Result<Self, Error>
Create a new optimization profile.
Note that the official TensorRT documentation states:
“If the network has any dynamic input tensors, the appropriate calls to setDimensions() must be made.”
But this part of the API has not been implemented yet in async-tensorrt
.
This function is still useful to allocate the optimization profile in the Builder
, which
may or may not actually affect the building process later.
sourcepub async fn config(&mut self) -> BuilderConfig
pub async fn config(&mut self) -> BuilderConfig
Create a builder configuration object.
Return value
A BuilderConfig
that can later be passed to build_serialized_network
.
sourcepub fn network_definition(
&mut self,
flags: NetworkDefinitionCreationFlags
) -> NetworkDefinition
pub fn network_definition( &mut self, flags: NetworkDefinitionCreationFlags ) -> NetworkDefinition
sourcepub async fn build_serialized_network(
&mut self,
network_definition: &mut NetworkDefinition,
config: BuilderConfig
) -> Result<HostBuffer, Error>
pub async fn build_serialized_network( &mut self, network_definition: &mut NetworkDefinition, config: BuilderConfig ) -> Result<HostBuffer, Error>
Builds and serializes a network for the provided crate::ffi::network::NetworkDefinition
and BuilderConfig
.
Arguments
network_definition
- Network definition.config
- Builder configuration.
sourcepub fn platform_has_fast_int8(&self) -> bool
pub fn platform_has_fast_int8(&self) -> bool
Determine whether the platform has fast native INT8.
sourcepub fn platform_has_fast_fp16(&self) -> bool
pub fn platform_has_fast_fp16(&self) -> bool
Determine whether the platform has fast native FP16.