InferencingOptionsPreview.PreferredDeviceKind Property

Definition

Deprecated. Gets or sets the preferred device that the evaluation will be performed on.

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

Property Value

The preferred device. The default value is LearningDeviceAny.

Attributes

Examples

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

    model.InferencingOptions = options;
}

Remarks

Warning

This is a deprecated API. Please use the Windows.AI.MachineLearning namespace instead.

Applies to