pub struct OptimizationProfile<'builder>(/* private fields */);
Expand description
Synchronous implementation of crate::OptimizationProfile
.
Refer to crate::OptimizationProfile
for documentation.
Implementations§
source§impl<'builder> OptimizationProfile<'builder>
impl<'builder> OptimizationProfile<'builder>
sourcepub fn set_min_shape_values(&mut self, input_name: &str, values: &[i32]) -> bool
pub fn set_min_shape_values(&mut self, input_name: &str, values: &[i32]) -> bool
Set the minimum values for an input shape tensor.
[TensorRT documentation](https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/classnvinfer1_1_1_i_optimization_profile.html#ad89508bb5e59d46d106cb74d701934850
Arguments
input_name
- Name of input tensor.values
- Shape values.
Return value
false
if an inconsistency was detected.
sourcepub fn set_opt_shape_values(&mut self, input_name: &str, values: &[i32]) -> bool
pub fn set_opt_shape_values(&mut self, input_name: &str, values: &[i32]) -> bool
Set the optimium values for an input shape tensor.
[TensorRT documentation](https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/classnvinfer1_1_1_i_optimization_profile.html#ad89508bb5e59d46d106cb74d701934850
Arguments
input_name
- Name of input tensor.values
- Shape values.
Return value
false
if an inconsistency was detected.
sourcepub fn set_max_shape_values(&mut self, input_name: &str, values: &[i32]) -> bool
pub fn set_max_shape_values(&mut self, input_name: &str, values: &[i32]) -> bool
Set the maximum values for an input shape tensor.
[TensorRT documentation](https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/classnvinfer1_1_1_i_optimization_profile.html#ad89508bb5e59d46d106cb74d701934850
Arguments
input_name
- Name of input tensor.values
- Shape values.
Return value
false
if an inconsistency was detected.
sourcepub fn get_min_shape_values(
&self,
input_name: &str
) -> Result<Option<Vec<i32>>, Error>
pub fn get_min_shape_values( &self, input_name: &str ) -> Result<Option<Vec<i32>>, Error>
Get the minimum values for an input shape tensor.
Arguments
input_name
- Name of input tensor.
Return value
Input shape if previously set.
sourcepub fn get_opt_shape_values(
&self,
input_name: &str
) -> Result<Option<Vec<i32>>, Error>
pub fn get_opt_shape_values( &self, input_name: &str ) -> Result<Option<Vec<i32>>, Error>
Get the optimum values for an input shape tensor.
Arguments
input_name
- Name of input tensor.
Return value
Input shape if previously set.
sourcepub fn get_max_shape_values(
&self,
input_name: &str
) -> Result<Option<Vec<i32>>, Error>
pub fn get_max_shape_values( &self, input_name: &str ) -> Result<Option<Vec<i32>>, Error>
Get the maximum values for an input shape tensor.
Arguments
input_name
- Name of input tensor.
Return value
Input shape if previously set.
sourcepub fn set_min_dimensions(&mut self, input_name: &str, dims: &[i32]) -> bool
pub fn set_min_dimensions(&mut self, input_name: &str, dims: &[i32]) -> bool
Set the minimum dimensions for a dynamic input tensor.
Arguments
input_name
- Name of input tensor.dims
- Dimensions.
Return value
false
if an inconsistency was detected.
sourcepub fn set_opt_dimensions(&mut self, input_name: &str, dims: &[i32]) -> bool
pub fn set_opt_dimensions(&mut self, input_name: &str, dims: &[i32]) -> bool
Set the optimum dimensions for a dynamic input tensor.
Arguments
input_name
- Name of input tensor.dims
- Dimensions.
Return value
false
if an inconsistency was detected.
sourcepub fn set_max_dimensions(&mut self, input_name: &str, dims: &[i32]) -> bool
pub fn set_max_dimensions(&mut self, input_name: &str, dims: &[i32]) -> bool
Set the maximum dimensions for a dynamic input tensor.
Arguments
input_name
- Name of input tensor.dims
- Dimensions.
Return value
false
if an inconsistency was detected.
sourcepub fn get_min_dimensions(&self, input_name: &str) -> Option<Vec<i32>>
pub fn get_min_dimensions(&self, input_name: &str) -> Option<Vec<i32>>
Get the minimum dimensions for a dynamic input tensor.
Arguments
input_name
- Name of input tensor.dims
- Dimensions.
Return value
Dimensions if they have been previously set.
sourcepub fn get_opt_dimensions(&self, input_name: &str) -> Option<Vec<i32>>
pub fn get_opt_dimensions(&self, input_name: &str) -> Option<Vec<i32>>
Get the optimum dimensions for a dynamic input tensor.
Arguments
input_name
- Name of input tensor.dims
- Dimensions.
Return value
Dimensions if they have been previously set.
sourcepub fn get_max_dimensions(&self, input_name: &str) -> Option<Vec<i32>>
pub fn get_max_dimensions(&self, input_name: &str) -> Option<Vec<i32>>
Get the maximum dimensions for a dynamic input tensor.
Arguments
input_name
- Name of input tensor.dims
- Dimensions.
Return value
Dimensions if they have been previously set.
sourcepub fn set_extra_memory_target(&mut self, target: f32) -> bool
pub fn set_extra_memory_target(&mut self, target: f32) -> bool
Set a target for extra GPU memory that may be used by this profile.
Arguments
target
- Additional memory that the builder should aim to maximally allocate for this profile, as a fraction of the memory it would use if the user did not impose any constraints on memory.
Return value
true
if the input is in the valid range (between 0 and 1 inclusive), else false
.
sourcepub fn get_extra_memory_target(&self) -> f32
pub fn get_extra_memory_target(&self) -> f32
Get the extra memory target that has been defined for this profile.
sourcepub fn as_mut_ptr(&mut self) -> *mut c_void
pub fn as_mut_ptr(&mut self) -> *mut c_void
Get internal mutable pointer.
Trait Implementations§
impl<'builder> Send for OptimizationProfile<'builder>
Implements Send
for OptimizationProfile
.
Safety
The TensorRT API is thread-safe with regards to all operations on OptimizationProfile
.
impl<'builder> Sync for OptimizationProfile<'builder>
Implements Sync
for OptimizationProfile
.
Safety
The TensorRT API is thread-safe with regards to all operations on OptimizationProfile
.