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>

source

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.

source

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.

source

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.

source

pub fn get_min_shape_values( &self, input_name: &str ) -> Result<Option<Vec<i32>>, Error>

Get the minimum values for an input shape tensor.

TensorRT documentation

Arguments
  • input_name - Name of input tensor.
Return value

Input shape if previously set.

source

pub fn get_opt_shape_values( &self, input_name: &str ) -> Result<Option<Vec<i32>>, Error>

Get the optimum values for an input shape tensor.

TensorRT documentation

Arguments
  • input_name - Name of input tensor.
Return value

Input shape if previously set.

source

pub fn get_max_shape_values( &self, input_name: &str ) -> Result<Option<Vec<i32>>, Error>

Get the maximum values for an input shape tensor.

TensorRT documentation

Arguments
  • input_name - Name of input tensor.
Return value

Input shape if previously set.

source

pub fn set_min_dimensions(&mut self, input_name: &str, dims: &[i32]) -> bool

Set the minimum dimensions for a dynamic input tensor.

TensorRT documentation

Arguments
  • input_name - Name of input tensor.
  • dims - Dimensions.
Return value

false if an inconsistency was detected.

source

pub fn set_opt_dimensions(&mut self, input_name: &str, dims: &[i32]) -> bool

Set the optimum dimensions for a dynamic input tensor.

TensorRT documentation

Arguments
  • input_name - Name of input tensor.
  • dims - Dimensions.
Return value

false if an inconsistency was detected.

source

pub fn set_max_dimensions(&mut self, input_name: &str, dims: &[i32]) -> bool

Set the maximum dimensions for a dynamic input tensor.

TensorRT documentation

Arguments
  • input_name - Name of input tensor.
  • dims - Dimensions.
Return value

false if an inconsistency was detected.

source

pub fn get_min_dimensions(&self, input_name: &str) -> Option<Vec<i32>>

Get the minimum dimensions for a dynamic input tensor.

TensorRT documentation

Arguments
  • input_name - Name of input tensor.
  • dims - Dimensions.
Return value

Dimensions if they have been previously set.

source

pub fn get_opt_dimensions(&self, input_name: &str) -> Option<Vec<i32>>

Get the optimum dimensions for a dynamic input tensor.

TensorRT documentation

Arguments
  • input_name - Name of input tensor.
  • dims - Dimensions.
Return value

Dimensions if they have been previously set.

source

pub fn get_max_dimensions(&self, input_name: &str) -> Option<Vec<i32>>

Get the maximum dimensions for a dynamic input tensor.

TensorRT documentation

Arguments
  • input_name - Name of input tensor.
  • dims - Dimensions.
Return value

Dimensions if they have been previously set.

source

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.

TensorRT documentation

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.

source

pub fn get_extra_memory_target(&self) -> f32

Get the extra memory target that has been defined for this profile.

TensorRT documentation

source

pub fn is_valid(&self) -> bool

Check whether the optimization profile is valid.

TensorRT documentation

source

pub fn as_ptr(&self) -> *const c_void

Get internal readonly pointer.

source

pub fn as_mut_ptr(&mut self) -> *mut c_void

Get internal mutable pointer.

Trait Implementations§

source§

impl<'builder> Send for OptimizationProfile<'builder>

Implements Send for OptimizationProfile.

Safety

The TensorRT API is thread-safe with regards to all operations on OptimizationProfile.

source§

impl<'builder> Sync for OptimizationProfile<'builder>

Implements Sync for OptimizationProfile.

Safety

The TensorRT API is thread-safe with regards to all operations on OptimizationProfile.

Auto Trait Implementations§

§

impl<'builder> RefUnwindSafe for OptimizationProfile<'builder>

§

impl<'builder> Unpin for OptimizationProfile<'builder>

§

impl<'builder> UnwindSafe for OptimizationProfile<'builder>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more