forked from TensorStack-AI/TensorStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelMetadata.cs
More file actions
35 lines (32 loc) · 1.03 KB
/
ModelMetadata.cs
File metadata and controls
35 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) TensorStack. All rights reserved.
// Licensed under the Apache 2.0 License.
using Microsoft.ML.OnnxRuntime;
using System.Collections.Generic;
using System.Linq;
namespace TensorStack.Core.Inference
{
public sealed record ModelMetadata
{
/// <summary>
/// Initializes a new instance of the <see cref="ModelMetadata"/> class.
/// </summary>
/// <param name="session">The session.</param>
public ModelMetadata(InferenceSession session)
{
Inputs = session.InputMetadata
.Select(NamedMetadata.Create)
.ToList();
Outputs = session.OutputMetadata
.Select(NamedMetadata.Create)
.ToList();
}
/// <summary>
/// Gets or sets the inputs.
/// </summary>
public IReadOnlyList<NamedMetadata> Inputs { get; }
/// <summary>
/// Gets or sets the outputs.
/// </summary>
public IReadOnlyList<NamedMetadata> Outputs { get; }
}
}