Skip to main content

ModelInference

Trait ModelInference 

Source
pub trait ModelInference {
    type InputTensor;
    type OutputTensor;

    // Required methods
    fn run(&mut self, input: &Self::InputTensor) -> Self::OutputTensor;
    fn create_input_tensor() -> Self::InputTensor;
}
Expand description

Typed tensor inference implemented directly by generated model instances.

Required Associated Types§

Required Methods§

Source

fn run(&mut self, input: &Self::InputTensor) -> Self::OutputTensor

Runs inference and returns an owned output tensor.

Source

fn create_input_tensor() -> Self::InputTensor

Creates a zero-filled input tensor with the model’s element type and dimensions.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§