Please use. NET 5,. NET 6, NET 7,. NET 8, NET Framework 4.6, NET Framework 4.61, NET Framework 4.7, NET Framework 4.72, NET Framework 4.8, NET Framework 4.81, and. NET Core 3.1 versions

IModel 类

Abstract base class for AI model inference AI模型推理的抽象基类

Definition

备注

Provides common infrastructure for model loading, inference and lifecycle management. 提供模型加载、推理和生命周期管理的公共基础设施。

Key responsibilities: 主要职责: - Model initialization and configuration 模型初始化和配置 - Inference pipeline execution 推理流程执行 - Performance profiling 性能分析 - Resource management 资源管理

构造函数

IModel Initializes model with specified configuration 使用指定配置初始化模型

属性

ModelInferenceProfiler Performance profiler recording timing metrics 记录时间指标的性能分析器

方法

Dispose Releases model resources 释放模型资源
EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
Postprocess Abstract method for output postprocessing 输出后处理的抽象方法
Predict(ListObject) Performs batch prediction on multiple inputs 对多个输入执行批量预测
Predict(Object) Performs prediction on single input 对单个输入执行预测
PredictAsync Asynchronously performs prediction on single input 异步执行单个输入预测
Preprocess Abstract method for input preprocessing 输入预处理的抽象方法
ToStringReturns a string that represents the current object.
(继承自 Object。)

字段

config Model configuration parameters 模型配置参数
engine Inference engine instance 推理引擎实例
predictorTimer Timer measuring different prediction phases 测量不同预测阶段的计时器

参见