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

已取代。 取得或設定是否要在模型評估之後回收配置的記憶體。

適用於