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§
type InputTensor
type OutputTensor
Required Methods§
Sourcefn run(&mut self, input: &Self::InputTensor) -> Self::OutputTensor
fn run(&mut self, input: &Self::InputTensor) -> Self::OutputTensor
Runs inference and returns an owned output tensor.
Sourcefn create_input_tensor() -> Self::InputTensor
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".