Share via


LearningModel.Author Propriété

Définition

Nom de l’auteur du modèle.

public:
 property Platform::String ^ Author { Platform::String ^ get(); };
winrt::hstring Author();
public string Author { get; }
var string = learningModel.author;
Public ReadOnly Property Author As String

Valeur de propriété

String

Platform::String

winrt::hstring

Nom de l’auteur du modèle.

Exemples

L’exemple suivant charge un modèle à partir d’un fichier local, génère l’auteur du modèle vers l’interface utilisateur de l’application et crée une session à partir du modèle.

private async Task LoadModelAsync(string _modelFileName)
{
    LearningModel _model;
    LearningModelSession _session;

    try
    {
        // Load and create the model
        var modelFile = 
            await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/{_modelFileName}"));
        _model = await LearningModel.LoadFromStorageFileAsync(modelFile);

        //Output the model author to application UI
        StatusBlock.Text = $"Model Author: {_model.Author}";

        // Create the evaluation session with the model
        _session = new LearningModelSession(_model);

    }
    catch (Exception ex)
    {
        StatusBlock.Text = $"error: {ex.Message}";
        _model = null;
    }
}

Remarques

Windows Server

Pour utiliser cette API sur Windows Server, vous devez utiliser Windows Server 2019 avec Expérience de bureau.

Sécurité des threads

Cette API est thread-safe.

S’applique à