LearningModelDeviceKindPreview 枚举

定义

已弃用。 定义表示 Windows 机器学习支持的设备类型的常量列表。

public enum class LearningModelDeviceKindPreview
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract, 65536)]
enum class LearningModelDeviceKindPreview
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("Use LearningModelDeviceKind instead of LearningModelDeviceKindPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
enum class LearningModelDeviceKindPreview
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract), 65536)]
public enum LearningModelDeviceKindPreview
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("Use LearningModelDeviceKind instead of LearningModelDeviceKindPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
public enum LearningModelDeviceKindPreview
var value = Windows.AI.MachineLearning.Preview.LearningModelDeviceKindPreview.learningDeviceAny
Public Enum LearningModelDeviceKindPreview
继承
LearningModelDeviceKindPreview
属性

Windows 要求

设备系列
Windows 10, version 1803 (在 10.0.17134.0 中引入)
API contract
Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract (在 v1.0 中引入)

字段

LearningDeviceAny 0

defualt 值。 任何设备。

LearningDeviceCpu 1

中央处理器。

LearningDeviceDsp 4

数字信号传送器。

LearningDeviceFpga 5

现场可编程门阵列。

LearningDeviceGpu 2

图形处理器。

LearningDeviceNpu 3

神经处理器。

示例

void SetEvaluationOptionsForModel(LearningModelPreview model)
{
    // Set our preference to use the GPU
    InferencingOptionsPreview options = model.InferencingOptions;
    options.PreferredDeviceKind = LearningModelDeviceKindPreview.LearningDeviceGpu;

    model.InferencingOptions = options;
}

注解

警告

这是一个已弃用的 API。 请改用 Windows.AI.MachineLearning 命名空间。

适用于