-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathModelConfig.cs
More file actions
33 lines (27 loc) · 1.05 KB
/
ModelConfig.cs
File metadata and controls
33 lines (27 loc) · 1.05 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
// Copyright (c) TensorStack. All rights reserved.
// Licensed under the Apache 2.0 License.
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace TensorStack.Common
{
public record ModelConfig
{
private ExecutionProvider _executionProvider;
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string Path { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool IsOptimizationSupported { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Dictionary<string, string> SessionOptions { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ExecutionProvider ExecutionProvider
{
get { return _executionProvider; }
init { _executionProvider = value; }
}
public virtual void SetProvider(ExecutionProvider executionProvider)
{
_executionProvider = executionProvider;
}
}
}