InferencingOptionsPreview.PreferredDeviceKind プロパティ

定義

非推奨になりました。 評価を実行する優先デバイスを取得または設定します。

public:
 property LearningModelDeviceKindPreview PreferredDeviceKind { LearningModelDeviceKindPreview get(); void set(LearningModelDeviceKindPreview value); };
LearningModelDeviceKindPreview PreferredDeviceKind();

void PreferredDeviceKind(LearningModelDeviceKindPreview value);
/// [get: Windows.Foundation.Metadata.Deprecated("Use LearningModel instead of IInferencingOptionsPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
/// [set: Windows.Foundation.Metadata.Deprecated("Use LearningModel instead of IInferencingOptionsPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
LearningModelDeviceKindPreview PreferredDeviceKind();

void PreferredDeviceKind(LearningModelDeviceKindPreview value);
public LearningModelDeviceKindPreview PreferredDeviceKind { get; set; }
public LearningModelDeviceKindPreview PreferredDeviceKind { [Windows.Foundation.Metadata.Deprecated("Use LearningModel instead of IInferencingOptionsPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")] get; [Windows.Foundation.Metadata.Deprecated("Use LearningModel instead of IInferencingOptionsPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")] set; }
var learningModelDeviceKindPreview = inferencingOptionsPreview.preferredDeviceKind;
inferencingOptionsPreview.preferredDeviceKind = learningModelDeviceKindPreview;
Public Property PreferredDeviceKind As LearningModelDeviceKindPreview

プロパティ値

優先デバイス。 既定値は LearningDeviceAny です。

属性

public 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 名前空間を 使用してください。

適用対象