forked from dotnet/machinelearning
/
OnnxOptions.cs
59 lines (49 loc) · 1.8 KB
/
OnnxOptions.cs
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
namespace Microsoft.ML.Transforms.Onnx
{
/// <summary>
/// The options for an <see cref="OnnxScoringEstimator"/>.
/// </summary>
public sealed class OnnxOptions
{
/// <summary>
/// Path to the onnx model file.
/// </summary>
public string ModelFile;
/// <summary>
/// Name of the input column.
/// </summary>
public string[] InputColumns;
/// <summary>
/// Name of the output column.
/// </summary>
public string[] OutputColumns;
/// <summary>
/// GPU device id to run on (e.g. 0,1,..). Null for CPU. Requires CUDA 9.1.
/// </summary>
public int? GpuDeviceId = null;
/// <summary>
/// If true, resumes execution on CPU upon GPU error. If false, will raise the GPU exception.
/// </summary>
public bool FallbackToCpu = false;
/// <summary>
/// ONNX shapes to be used over those loaded from <see cref="ModelFile"/>.
/// </summary>
public IDictionary<string, int[]> ShapeDictionary;
/// <summary>
/// Protobuf CodedInputStream recursion limit.
/// </summary>
public int RecursionLimit = 100;
/// <summary>
/// Controls the number of threads used to parallelize the execution of the graph (across nodes).
/// </summary>
public int? InterOpNumThreads = null;
/// <summary>
/// Controls the number of threads to use to run the model.
/// </summary>
public int? IntraOpNumThreads = null;
}
}