Interface IInferenceEngine<TInput, TOutput>
- Namespace
- InferenceEngine.Core
- Assembly
- InferenceEngine.Core.dll
A generic contract for an AI Inference Engine. Implementation details (ONNX, TensorFlow, Mock) are abstracted away.
public interface IInferenceEngine<TInput, TOutput> : IDisposable
Type Parameters
TInputThe type of input data (e.g., byte[] for images, string for text).
TOutputThe type of output data (e.g., List<Prediction>, string response).
- Inherited Members
Methods
LoadAsync()
Initializes the engine, loads the model, and performs hardware warmup. This handles the "First Run" latency (e.g., DirectML graph compilation).
Task LoadAsync()
Returns
PredictAsync(TInput)
Runs the inference pipeline: PreProcess -> Inference -> PostProcess.
Task<TOutput> PredictAsync(TInput input)
Parameters
inputTInputThe raw input data.
Returns
- Task<TOutput>
The processed prediction result.