Share via


LearningModelPreview.InferencingOptions Property

Definition

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

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

Property Value

The inferencing options for the evaluation of a model.

Attributes

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.

Applies to