Compartilhar via


InferencingOptionsPreview.PreferredDeviceKind Propriedade

Definição

Preterido. Obtém ou define o dispositivo preferencial no qual a avaliação será executada.

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

Valor da propriedade

O dispositivo preferencial. O valor padrão é LearningDeviceAny.

Atributos

Exemplos

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

    model.InferencingOptions = options;
}

Comentários

Aviso

Essa é uma API preterida. Em vez disso, use o namespace Windows.AI.MachineLearning .

Aplica-se a