Compartilhar via


LearningModelPreview.LoadModelFromStorageFileAsync(IStorageFile) Método

Definição

Preterido. Carrega de forma assíncrona um modelo do armazenamento de arquivos.

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)

Parâmetros

modelFile
IStorageFile

O local do arquivo de modelo.

Retornos

Retorna um LearningModelPreview.

Atributos

Exemplos

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

Comentários

Aviso

Essa é uma API preterida. Em vez disso, use o namespace Windows.AI.MachineLearning .

Aplica-se a