LearningModelPreview.InferencingOptions LearningModelPreview.InferencingOptions LearningModelPreview.InferencingOptions LearningModelPreview.InferencingOptions LearningModelPreview.InferencingOptions Property

Definition

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

public : IInferencingOptionsPreview InferencingOptions { get; set; }
IInferencingOptionsPreview InferencingOptions();

void InferencingOptions(IInferencingOptionsPreview inferencingoptions);
public IInferencingOptionsPreview InferencingOptions { get; set; }
Public ReadWrite Property InferencingOptions As IInferencingOptionsPreview
var iInferencingOptionsPreview = learningModelPreview.inferencingOptions;
learningModelPreview.inferencingOptions = iInferencingOptionsPreview;

Property Value

IInferencingOptionsPreview IInferencingOptionsPreview IInferencingOptionsPreview

The inferencing options for the evaluation of a model.

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

Remarks

Warning

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