InferencingOptionsPreview 类

定义

已弃用。 表示用于控制模型计算的推理选项。

public ref class InferencingOptionsPreview sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract, 65536)]
class InferencingOptionsPreview final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("Use LearningModelSession instead of InferencingOptionsPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
class InferencingOptionsPreview final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract), 65536)]
public sealed class InferencingOptionsPreview
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("Use LearningModelSession instead of InferencingOptionsPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
public sealed class InferencingOptionsPreview
Public NotInheritable Class InferencingOptionsPreview
继承
Object Platform::Object IInspectable InferencingOptionsPreview
属性

Windows 要求

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

示例

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 命名空间。

属性

IsTracingEnabled

已弃用。 获取或设置在模型评估期间是否启用跟踪。

MaxBatchSize

已弃用。 获取或设置模型评估的最大批大小。

MinimizeMemoryAllocation

已弃用。 获取或设置是否在模型评估后最小化内存分配。

PreferredDeviceKind

已弃用。 获取或设置将执行评估的首选设备。

ReclaimMemoryAfterEvaluation

已弃用。 获取或设置在模型评估后是否回收分配的内存。

适用于