-
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
Conversation
- Cleaned up column comparison functionality on OnnxConversionTest - Fixed bugs in OptionalColumnTransform's onnx export and added support for boolean initializers
@@ -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 |
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.
float [](start = 51, length = 5)
long? #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(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 |
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.
double [](start = 51, length = 6)
ulong? #Resolved
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.
/// <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 |
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.
This conflicts with the type param description: "Use this for adding array initializers of integer types smaller than Int32" #Resolved
/// </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> |
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.
Is the type inclusive of Int32s? #Resolved
OptionalColumnTransform didn't have support for boolean initializers. When I went to add that I saw that the TensorProto data was being set incorrectly for a few other data types. I tried to fix that and I had to redo the AddInitializer functionality in OnnxContext and related plumbing in OnnxUtils.cs.
Then when I went to add tests for all the data types that are now supported in OptionalColumnTransform, I realized I needed to simplify the column comparison in OnnxConversionTest. In the process I also added support SByte and Byte in OnnxUtils - CreateNamedValue and fixed up the corresponding tests.
In summary: