Repository navigation
Expand file tree
/
Copy pathStaticApi.cs
More file actions
56 lines (45 loc) · 1.72 KB
/
Copy pathStaticApi.cs
File metadata and controls
56 lines (45 loc) · 1.72 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Text;
using CodeMinion.Core.Helpers;
namespace CodeMinion.Core.Models
{
public class Api
{
/// <summary>
/// API declarations
/// </summary>
public List<Declaration> Declarations { get; set; } = new List<Declaration>();
/// <summary>
/// Target directory for the generated files
/// </summary>
public string OutputPath { get; set; }
/// <summary>
/// Additional name of a partial API file (required for splitting the API into multiple partial class files)
/// </summary>
public string PartialName { get; set; }
public string SubDir { get; set; }
}
/// <summary>
/// Represents a static API class that should be generated
/// </summary>
public class StaticApi : Api
{
/// <summary>
/// Static name is the name of a static class that forwards to a singleton instance of the API implementation
/// </summary>
public string StaticName { get; set; } = "torch";
/// <summary>
/// The static class forwards to this Singleton instance which is the API implementation
/// </summary>
public string ImplName { get; set; } = "PyTorch";
/// <summary>
/// The python module this API represents
/// </summary>
public string PythonModule { get; set; } = "torch";
/// <summary>
/// These are generated into the constructor of the API implementation object
/// </summary>
public List<Action<CodeWriter>> InitializationGenerators { get; set; } = new List<Action<CodeWriter>>();
}
}