Partager via


LearningModelPreview.InferencingOptions Propriété

Définition

Action déconseillée. Obtient ou définit les options d’inférence pour l’évaluation d’un modèle.

public:
 property InferencingOptionsPreview ^ InferencingOptions { InferencingOptionsPreview ^ get(); void set(InferencingOptionsPreview ^ value); };
InferencingOptionsPreview InferencingOptions();

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

void InferencingOptions(InferencingOptionsPreview value);
public InferencingOptionsPreview InferencingOptions { get; set; }
public InferencingOptionsPreview InferencingOptions { [Windows.Foundation.Metadata.Deprecated("Use ILearningModel instead of ILearningModelPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")] get; [Windows.Foundation.Metadata.Deprecated("Use ILearningModel instead of ILearningModelPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")] set; }
var inferencingOptionsPreview = learningModelPreview.inferencingOptions;
learningModelPreview.inferencingOptions = inferencingOptionsPreview;
Public Property InferencingOptions As InferencingOptionsPreview

Valeur de propriété

Options d’inférence pour l’évaluation d’un modèle.

Attributs

Exemples

public async Task LoadModelAsync()
{
	// Load Model
    var modelFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("model.onnx");
    LearningModelPreview model = await LearningModelPreview.LoadModelFromStorageFileAsync(modelFile);


	//Set inferencing options to use GPU
	InferencingOptionsPreview options = model.InferencingOptions;
	options.PreferredDeviceKind = LearningModelDeviceKindPreview.LearningDeviceCpu;
	model.InferencingOptions = options;
}

Remarques

Avertissement

Il s’agit d’une API déconseillée. Utilisez plutôt l’espace de noms Windows.AI.MachineLearning .

S’applique à