LearningModelPreview.LoadModelFromStorageFileAsync(IStorageFile) Метод

Определение

Не рекомендуется. Асинхронно загружает модель из хранилища файлов.

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)

Параметры

modelFile
IStorageFile

Расположение файла модели.

Возвращаемое значение

Возвращает LearningModelPreview.

Атрибуты

Примеры

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

Комментарии

Предупреждение

Это нерекомендуемый API. Вместо этого используйте пространство имен Windows.AI.MachineLearning .

Применяется к