Compartir a través de


LearningModelPreview.InferencingOptions Propiedad

Definición

En desuso. Obtiene o establece las opciones de inferencia para la evaluación de un modelo.

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

Valor de propiedad

Las opciones de inferencia para la evaluación de un modelo.

Atributos

Ejemplos

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

Comentarios

Advertencia

Se trata de una API en desuso. Use el espacio de nombres Windows.AI.MachineLearning en su lugar.

Se aplica a