pub trait ModelSession: Send {
// Required methods
fn backend_name(&self) -> &str;
fn model_info(&self) -> &ModelInfo;
fn run_with_options(
&mut self,
inputs: NamedTensors,
options: RunOptions,
) -> AiResult<NamedTensors>;
// Provided methods
fn run(&mut self, inputs: NamedTensors) -> AiResult<NamedTensors> { ... }
fn run_with_binding(&mut self, _binding: &mut IoBinding) -> AiResult<()> { ... }
}Expand description
Loaded model session with named dynamic I/O.
Required Methods§
Sourcefn backend_name(&self) -> &str
fn backend_name(&self) -> &str
Stable backend identifier for diagnostics and capability checks.
Sourcefn model_info(&self) -> &ModelInfo
fn model_info(&self) -> &ModelInfo
Returns model input/output metadata captured at load time.
Sourcefn run_with_options(
&mut self,
inputs: NamedTensors,
options: RunOptions,
) -> AiResult<NamedTensors>
fn run_with_options( &mut self, inputs: NamedTensors, options: RunOptions, ) -> AiResult<NamedTensors>
Runs named I/O with explicit host copy permissions.
Provided Methods§
Sourcefn run(&mut self, inputs: NamedTensors) -> AiResult<NamedTensors>
fn run(&mut self, inputs: NamedTensors) -> AiResult<NamedTensors>
Runs without authorizing hidden host copies.
Sourcefn run_with_binding(&mut self, _binding: &mut IoBinding) -> AiResult<()>
fn run_with_binding(&mut self, _binding: &mut IoBinding) -> AiResult<()>
Runs with explicit input/output device or allocation bindings.