-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed bugs in OptionalColumnTransform and added bool support #4815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| // 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; | ||
| using System.Collections.Generic; | ||
| using Microsoft.ML.Data; | ||
|
|
||
|
|
@@ -130,7 +131,16 @@ public OnnxNode CreateNode(string opType, string input, string output, string na | |
| public abstract List<long> RetrieveShapeOrNull(string variableName); | ||
|
|
||
| /// <summary> | ||
| /// Call this function can declare a global float | ||
| /// Call this function to declare a global bool | ||
| /// </summary> | ||
| /// <param name="value">The boolean value which is going to be added</param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(bool value, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function to declare a global float | ||
| /// </summary> | ||
| /// <param name="value">The float number which is going to be added</param> | ||
| /// <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 | |
| public abstract string AddInitializer(float value, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function can declare a global long | ||
| /// Call this function to declare a global float | ||
| /// </summary> | ||
| /// <param name="value">The long number which is going to be added into the ONNX graph</param> | ||
| /// <param name="value">The float number which is going to be added</param> | ||
| /// <param name="type">The type of integer to be added, e.g. typeof(short). Use this for all integer types smaller than Int32</param> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the type inclusive of Int32s? #Resolved |
||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(long value, string name = null, bool makeUniqueName = true); | ||
| public abstract string AddInitializer(int value, Type type, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function can declare a global string | ||
| /// Call this function to declare a global string | ||
| /// </summary> | ||
| /// <param name="value">The string which is going to be added into the ONNX graph</param> | ||
| /// <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 | |
| public abstract string AddInitializer(string value, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function can declare a global float tensor | ||
| /// Call this function to declare a global long | ||
| /// </summary> | ||
| /// <param name="value">The long number which is going to be added into the ONNX graph</param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(long value, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function to declare a global double | ||
| /// </summary> | ||
| /// <param name="value">The double number which is going to be added into the ONNX graph</param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(double value, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function to declare a global ulong or uint | ||
| /// </summary> | ||
| /// <param name="value">The long number which is going to be added into the ONNX graph</param> | ||
| /// <param name="isUint64">true if value contains a ulong value and false if it contains uint </param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(ulong value, bool isUint64, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function to declare a global bool tensor | ||
| /// </summary> | ||
| /// <param name="values">The boolean values which are going to be added into the ONNX graph</param> | ||
| /// <param name="dims">The shape of values</param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(IEnumerable<bool> values, IEnumerable<long> dims, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function to declare a global float tensor | ||
| /// </summary> | ||
| /// <param name="values">The floats which are going to be added into the ONNX graph</param> | ||
| /// <param name="dims">The shape that the floats</param> | ||
| /// <param name="dims">The shape of values</param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(IEnumerable<float> values, IEnumerable<long> dims, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function can declare a global long tensor | ||
| /// Call this function to declare a global long tensor | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This conflicts with the type param description: "Use this for adding array initializers of integer types smaller than Int32" #Resolved |
||
| /// </summary> | ||
| /// <param name="values">The ints which are going to be added into the ONNX graph</param> | ||
| /// <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> | ||
| /// <param name="dims">The shape of values</param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(IEnumerable<int> values, Type type, IEnumerable<long> dims, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function to declare a global string tensor | ||
| /// </summary> | ||
| /// <param name="values">The strings which are going to be added into the ONNX graph</param> | ||
| /// <param name="dims">The shape of values</param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(IEnumerable<string> values, IEnumerable<long> dims, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function to declare a global long tensor | ||
| /// </summary> | ||
| /// <param name="values">The longs which are going to be added into the ONNX graph</param> | ||
| /// <param name="dims">The shape that the floats</param> | ||
| /// <param name="dims">The shape of values</param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(IEnumerable<long> values, IEnumerable<long> dims, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function can declare a global double tensor | ||
| /// Call this function to declare a global double tensor | ||
| /// </summary> | ||
| /// <param name="values">The doubles which are going to be added into the ONNX graph</param> | ||
| /// <param name="dims">The shape that the doubles</param> | ||
| /// <param name="dims">The shape of values</param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(IEnumerable<double> values, IEnumerable<long> dims, string name = null, bool makeUniqueName = true); | ||
|
|
||
| /// <summary> | ||
| /// Call this function can declare a global string tensor | ||
| /// Call this function to declare a global double tensor | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ulong? #Resolved |
||
| /// </summary> | ||
| /// <param name="values">The strings which are going to be added into the ONNX graph</param> | ||
| /// <param name="dims">The shape that the strings</param> | ||
| /// <param name="values">The unsigned integers which are going to be added into the ONNX graph</param> | ||
| /// <param name="isUint64">Set to true if values contain ulong values false if they contain uint values</param> | ||
| /// <param name="dims">The shape of values</param> | ||
| /// <param name="name">A string used as a seed to generate this initializer's name in the ONNX graph.</param> | ||
| /// <param name="makeUniqueName">Whether a unique name should be picked for this initializer.</param> | ||
| /// <returns>The initializer's ONNX name</returns> | ||
| public abstract string AddInitializer(IEnumerable<string> values, IEnumerable<long> dims, string name = null, bool makeUniqueName = true); | ||
| public abstract string AddInitializer(IEnumerable<ulong> values, bool isUint64, IEnumerable<long> dims, string name = null, bool makeUniqueName = true); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
long? #Resolved