Skip to content

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

Merged
merged 2 commits into from
Feb 10, 2020
Merged

Fixed bugs in OptionalColumnTransform and added bool support #4815

merged 2 commits into from
Feb 10, 2020

Conversation

harishsk
Copy link
Contributor

@harishsk harishsk commented Feb 8, 2020

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:

  • Cleaned up OnnxContext's initializer interface
  • Cleaned up column comparison functionality on OnnxConversionTest
  • Fixed bugs in OptionalColumnTransform's onnx export and added support for boolean initializers

- Cleaned up column comparison functionality on OnnxConversionTest
- Fixed bugs in OptionalColumnTransform's onnx export and added support for boolean initializers
@harishsk harishsk requested a review from a team as a code owner February 8, 2020 02:22
@@ -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
Copy link
Member

@ganik ganik Feb 10, 2020

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
Copy link
Member

@ganik ganik Feb 10, 2020

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

Copy link
Member

@ganik ganik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

/// <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
Copy link
Contributor

@Lynx1820 Lynx1820 Feb 10, 2020

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>
Copy link
Contributor

@Lynx1820 Lynx1820 Feb 10, 2020

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

@harishsk harishsk merged commit a7fa16c into dotnet:master Feb 10, 2020
@harishsk harishsk deleted the optionalCol branch April 21, 2020 23:59
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants