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

InferEngineFactory 类

Factory class for creating inference engine instances based on backend type. 根据后端类型创建推理引擎实例的工厂类

Definition

命名空间: DeploySharp.Engine
程序集: DeploySharp (在 DeploySharp.dll 中) 版本:0.0.4+6e8a2e904469617cd59619d666c0e272985c0e33
C#
public class InferEngineFactory
Inheritance
Object    InferEngineFactory

备注

Provides a centralized creation point for different inference implementations, abstracting concrete engine instantiation from consuming code. 为不同的推理实现提供集中的创建点,将对具体引擎的实例化与使用代码解耦。

This factory ensures proper initialization of backend-specific implementations following consistent patterns. 该工厂确保后端特定实现的正确初始化遵循一致的模式。

示例

C#
// Create an ONNX Runtime inference engine
var engine = InferEngineFactory.Create(InferenceBackend.OnnxRuntime);

// Create an OpenVINO inference engine
var openVinoEngine = InferEngineFactory.Create(InferenceBackend.OpenVINO);

构造函数

InferEngineFactory初始化 InferEngineFactory 类的一个新实例

方法

Create Creates an inference engine instance for the specified backend type. 为指定的后端类型创建推理引擎实例
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。)
ToStringReturns a string that represents the current object.
(继承自 Object。)

参见