Partager via


LearningModelPreview.LoadModelFromStorageFileAsync(IStorageFile) Méthode

Définition

Action déconseillée. Charge de manière asynchrone un modèle à partir du stockage de fichiers.

public:
 static IAsyncOperation<LearningModelPreview ^> ^ LoadModelFromStorageFileAsync(IStorageFile ^ modelFile);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<LearningModelPreview> LoadModelFromStorageFileAsync(IStorageFile const& modelFile);
/// [Windows.Foundation.Metadata.RemoteAsync]
/// [Windows.Foundation.Metadata.Deprecated("Use ILearningModelStatics instead of ILearningModelPreviewStatics. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
 static IAsyncOperation<LearningModelPreview> LoadModelFromStorageFileAsync(IStorageFile const& modelFile);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<LearningModelPreview> LoadModelFromStorageFileAsync(IStorageFile modelFile);
[Windows.Foundation.Metadata.RemoteAsync]
[Windows.Foundation.Metadata.Deprecated("Use ILearningModelStatics instead of ILearningModelPreviewStatics. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
public static IAsyncOperation<LearningModelPreview> LoadModelFromStorageFileAsync(IStorageFile modelFile);
function loadModelFromStorageFileAsync(modelFile)
Public Shared Function LoadModelFromStorageFileAsync (modelFile As IStorageFile) As IAsyncOperation(Of LearningModelPreview)

Paramètres

modelFile
IStorageFile

Emplacement du fichier de modèle.

Retours

Retourne une vue LearningModelPreview.

Attributs

Exemples

public async Task LoadModel()
{
    var modelFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("model.onnx");
    LearningModelPreview model = await LearningModelPreview.LoadModelFromStorageFileAsync(modelFile);
}

Remarques

Avertissement

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

S’applique à