pub struct Engine<'rt> { /* private fields */ }Expand description
Represents a deserialized TensorRT engine borrowed from its parent runtime.
Implementations§
Source§impl Engine<'_>
impl Engine<'_>
pub fn as_raw(&self) -> trtICudaEngine_t
pub fn num_io_tensors(&self) -> Result<i32>
pub fn io_tensor_name(&self, index: i32) -> Result<String>
pub fn tensor_io_mode(&self, name: &str) -> Result<IoMode>
pub fn tensor_data_type(&self, name: &str) -> Result<DataType>
pub fn tensor_shape(&self, name: &str) -> Result<Dims>
pub fn create_execution_context(&self) -> Result<ExecutionContext<'_>>
Sourcepub fn create_execution_context_with_strategy(
&self,
strategy: AllocStrategy,
) -> Result<ExecutionContext<'_>>
pub fn create_execution_context_with_strategy( &self, strategy: AllocStrategy, ) -> Result<ExecutionContext<'_>>
Create an execution context with a user-chosen allocation strategy.
Use AllocStrategy::UserManaged when you intend to supply a
scratch-allocator yourself; AllocStrategy::Static preallocates
the maximum workspace at context-creation time.
Sourcepub fn num_optimization_profiles(&self) -> Result<i32>
pub fn num_optimization_profiles(&self) -> Result<i32>
Number of optimization profiles that were baked into the engine.
Sourcepub fn serialize(&self) -> Result<HostMemory>
pub fn serialize(&self) -> Result<HostMemory>
Serialize this engine back into a byte blob you can round-trip to
disk. The returned HostMemory owns TensorRT-allocated storage;
use HostMemory::as_slice to copy.
Trait Implementations§
Auto Trait Implementations§
impl<'rt> Freeze for Engine<'rt>
impl<'rt> RefUnwindSafe for Engine<'rt>
impl<'rt> !Send for Engine<'rt>
impl<'rt> !Sync for Engine<'rt>
impl<'rt> Unpin for Engine<'rt>
impl<'rt> UnsafeUnpin for Engine<'rt>
impl<'rt> UnwindSafe for Engine<'rt>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more