Skip to main content

RuntimeSession

Trait RuntimeSession 

Source
pub trait RuntimeSession:
    Send
    + Sync
    + 'static {
    // Required method
    fn run(&self, inputs: &[Tensor]) -> Result<Vec<Tensor>, RuntimeError>;

    // Provided methods
    fn run_low_latency(
        &self,
        inputs: &[Tensor],
    ) -> Result<Vec<Tensor>, RuntimeError> { ... }
    fn is_ane_encoder(&self) -> bool { ... }
}
Expand description

One loaded model session: encoder, decoder, or joiner.

Required Methods§

Source

fn run(&self, inputs: &[Tensor]) -> Result<Vec<Tensor>, RuntimeError>

Provided Methods§

Source

fn run_low_latency( &self, inputs: &[Tensor], ) -> Result<Vec<Tensor>, RuntimeError>

Low-latency encoder path used by streaming windows.

Default delegates to Self::run. The ANE encoder overrides this to accept a lower pad fill floor so short streaming windows can pad into the smallest eligible bucket instead of falling back to ort.

Source

fn is_ane_encoder(&self) -> bool

True when this encoder runs on the ANE fixed-shape pad-up path.

Used to pick a longer long-form chunk window (30s fills ANE bucket 3000 nearly full; ort keeps 24s for peak activation memory). Default false.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§