Share via


LearningModelPreview.LoadModelFromStorageFileAsync(IStorageFile) Method

Definition

Deprecated. Asynchronously loads a model from file storage.

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)

Parameters

modelFile
IStorageFile

The location of the model file.

Returns

Returns a LearningModelPreview.

Attributes

Examples

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

Remarks

Warning

This is a deprecated API. Please use the Windows.AI.MachineLearning namespace instead.

Applies to