Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.19 KB

learningmodelpreview_inferencingoptions.md

File metadata and controls

39 lines (29 loc) · 1.19 KB
-api-id -api-type
P:Windows.AI.MachineLearning.Preview.LearningModelPreview.InferencingOptions
winrt property

Windows.AI.MachineLearning.Preview.LearningModelPreview.InferencingOptions

-description

Deprecated. Gets or sets the inferencing options for the evaluation of a model.

-property-value

The inferencing options for the evaluation of a model.

-remarks

Warning

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

-see-also

-examples

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;
}