2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
+ using System ;
5
6
using System . Collections . Generic ;
6
7
using Microsoft . ML . Data ;
7
8
@@ -130,7 +131,16 @@ public OnnxNode CreateNode(string opType, string input, string output, string na
130
131
public abstract List < long > RetrieveShapeOrNull ( string variableName ) ;
131
132
132
133
/// <summary>
133
- /// Call this function can declare a global float
134
+ /// Call this function to declare a global bool scalar
135
+ /// </summary>
136
+ /// <param name="value">The boolean value which is going to be added</param>
137
+ /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
138
+ /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
139
+ /// <returns>The initializer's ONNX name</returns>
140
+ public abstract string AddInitializer ( bool value , string name = null , bool makeUniqueName = true ) ;
141
+
142
+ /// <summary>
143
+ /// Call this function to declare a global float scalar
134
144
/// </summary>
135
145
/// <param name="value">The float number which is going to be added</param>
136
146
/// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
@@ -139,16 +149,17 @@ public OnnxNode CreateNode(string opType, string input, string output, string na
139
149
public abstract string AddInitializer ( float value , string name = null , bool makeUniqueName = true ) ;
140
150
141
151
/// <summary>
142
- /// Call this function can declare a global long
152
+ /// Call this function to declare a global integer scalar or smaller types
143
153
/// </summary>
144
- /// <param name="value">The long number which is going to be added into the ONNX graph</param>
154
+ /// <param name="value">The float number which is going to be added</param>
155
+ /// <param name="type">The type of integer to be added, e.g. typeof(short). Use this for all integer types Int32 and smaller</param>
145
156
/// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
146
157
/// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
147
158
/// <returns>The initializer's ONNX name</returns>
148
- public abstract string AddInitializer ( long value , string name = null , bool makeUniqueName = true ) ;
159
+ public abstract string AddInitializer ( int value , Type type , string name = null , bool makeUniqueName = true ) ;
149
160
150
161
/// <summary>
151
- /// Call this function can declare a global string
162
+ /// Call this function to declare a global string scalar
152
163
/// </summary>
153
164
/// <param name="value">The string which is going to be added into the ONNX graph</param>
154
165
/// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
@@ -157,43 +168,103 @@ public OnnxNode CreateNode(string opType, string input, string output, string na
157
168
public abstract string AddInitializer ( string value , string name = null , bool makeUniqueName = true ) ;
158
169
159
170
/// <summary>
160
- /// Call this function can declare a global float tensor
171
+ /// Call this function to declare a global long scalar
172
+ /// </summary>
173
+ /// <param name="value">The long number which is going to be added into the ONNX graph</param>
174
+ /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
175
+ /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
176
+ /// <returns>The initializer's ONNX name</returns>
177
+ public abstract string AddInitializer ( long value , string name = null , bool makeUniqueName = true ) ;
178
+
179
+ /// <summary>
180
+ /// Call this function to declare a global double scalar
181
+ /// </summary>
182
+ /// <param name="value">The double number which is going to be added into the ONNX graph</param>
183
+ /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
184
+ /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
185
+ /// <returns>The initializer's ONNX name</returns>
186
+ public abstract string AddInitializer ( double value , string name = null , bool makeUniqueName = true ) ;
187
+
188
+ /// <summary>
189
+ /// Call this function to declare a global ulong or uint scalar
190
+ /// </summary>
191
+ /// <param name="value">The long number which is going to be added into the ONNX graph</param>
192
+ /// <param name="isUint64">true if value contains a ulong value and false if it contains uint </param>
193
+ /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
194
+ /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
195
+ /// <returns>The initializer's ONNX name</returns>
196
+ public abstract string AddInitializer ( ulong value , bool isUint64 , string name = null , bool makeUniqueName = true ) ;
197
+
198
+ /// <summary>
199
+ /// Call this function to declare a global bool tensor
200
+ /// </summary>
201
+ /// <param name="values">The boolean values which are going to be added into the ONNX graph</param>
202
+ /// <param name="dims">The shape of values</param>
203
+ /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
204
+ /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
205
+ /// <returns>The initializer's ONNX name</returns>
206
+ public abstract string AddInitializer ( IEnumerable < bool > values , IEnumerable < long > dims , string name = null , bool makeUniqueName = true ) ;
207
+
208
+ /// <summary>
209
+ /// Call this function to declare a global float tensor
161
210
/// </summary>
162
211
/// <param name="values">The floats which are going to be added into the ONNX graph</param>
163
- /// <param name="dims">The shape that the floats </param>
212
+ /// <param name="dims">The shape of values </param>
164
213
/// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
165
214
/// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
166
215
/// <returns>The initializer's ONNX name</returns>
167
216
public abstract string AddInitializer ( IEnumerable < float > values , IEnumerable < long > dims , string name = null , bool makeUniqueName = true ) ;
168
217
169
218
/// <summary>
170
- /// Call this function can declare a global long tensor
219
+ /// Call this function to declare a global tensor of integer or smaller types
220
+ /// </summary>
221
+ /// <param name="values">The ints which are going to be added into the ONNX graph</param>
222
+ /// <param name="type">The type of ints which are going to be added into the ONNX graph, e.g. typeof(short). Use this for adding array initializers of integer types smaller than Int32</param>
223
+ /// <param name="dims">The shape of values</param>
224
+ /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
225
+ /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
226
+ /// <returns>The initializer's ONNX name</returns>
227
+ public abstract string AddInitializer ( IEnumerable < int > values , Type type , IEnumerable < long > dims , string name = null , bool makeUniqueName = true ) ;
228
+
229
+ /// <summary>
230
+ /// Call this function to declare a global string tensor
231
+ /// </summary>
232
+ /// <param name="values">The strings which are going to be added into the ONNX graph</param>
233
+ /// <param name="dims">The shape of values</param>
234
+ /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
235
+ /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
236
+ /// <returns>The initializer's ONNX name</returns>
237
+ public abstract string AddInitializer ( IEnumerable < string > values , IEnumerable < long > dims , string name = null , bool makeUniqueName = true ) ;
238
+
239
+ /// <summary>
240
+ /// Call this function to declare a global long tensor
171
241
/// </summary>
172
242
/// <param name="values">The longs which are going to be added into the ONNX graph</param>
173
- /// <param name="dims">The shape that the floats </param>
243
+ /// <param name="dims">The shape of values </param>
174
244
/// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
175
245
/// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
176
246
/// <returns>The initializer's ONNX name</returns>
177
247
public abstract string AddInitializer ( IEnumerable < long > values , IEnumerable < long > dims , string name = null , bool makeUniqueName = true ) ;
178
248
179
249
/// <summary>
180
- /// Call this function can declare a global double tensor
250
+ /// Call this function to declare a global double tensor
181
251
/// </summary>
182
252
/// <param name="values">The doubles which are going to be added into the ONNX graph</param>
183
- /// <param name="dims">The shape that the doubles </param>
253
+ /// <param name="dims">The shape of values </param>
184
254
/// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
185
255
/// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
186
256
/// <returns>The initializer's ONNX name</returns>
187
257
public abstract string AddInitializer ( IEnumerable < double > values , IEnumerable < long > dims , string name = null , bool makeUniqueName = true ) ;
188
258
189
259
/// <summary>
190
- /// Call this function can declare a global string tensor
260
+ /// Call this function to declare a global ulong tensor
191
261
/// </summary>
192
- /// <param name="values">The strings which are going to be added into the ONNX graph</param>
193
- /// <param name="dims">The shape that the strings</param>
262
+ /// <param name="values">The unsigned integers which are going to be added into the ONNX graph</param>
263
+ /// <param name="isUint64">Set to true if values contain ulong values false if they contain uint values</param>
264
+ /// <param name="dims">The shape of values</param>
194
265
/// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param>
195
266
/// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param>
196
267
/// <returns>The initializer's ONNX name</returns>
197
- public abstract string AddInitializer ( IEnumerable < string > values , IEnumerable < long > dims , string name = null , bool makeUniqueName = true ) ;
268
+ public abstract string AddInitializer ( IEnumerable < ulong > values , bool isUint64 , IEnumerable < long > dims , string name = null , bool makeUniqueName = true ) ;
198
269
}
199
270
}
0 commit comments